Search code examples
cocoanstextviewtldnsdatadetector

What are all the tld's recognized by NSDataDetector?


When testing Cocoa data detector I found that forecast.io isn't picked up but www.forecast.io and forecast.com are.

What are all the top level domains found by NSDataDetector without prefixing them with www.?


Solution

  • I wrote about how to pick an Apple friendly TLD and my findings are recounted below.

    I just took the text file from ICANN and prepended all the extensions with 'example.' and the only ones detected at least in my locale(US) were these:

    Uppercase:

    example.com
    example.EDU
    example.EU
    example.GOV
    example.LY
    example.NET
    example.ORG
    

    Lowercase:

    example.ar
    example.at
    example.au
    example.be
    example.br
    example.ca
    example.ch
    example.cn
    example.de
    example.dk
    example.edu
    example.es
    example.eu
    example.fi
    example.fr
    example.gov
    example.gr
    example.hk
    example.hu
    example.il
    example.is
    example.it
    example.jp
    example.kr
    example.lu
    example.ly
    example.ma
    example.mx
    example.net
    example.nl
    example.no
    example.nz
    example.org
    example.pt
    example.ru
    example.se
    example.sg
    example.th
    example.tn
    example.tr
    example.tw
    example.ua
    example.uk
    example.us