In javascript can you really produce a function that inspections an url to obtain the domain title. EG: if these websites:

world wide web.site.co.united kingdom

world wide web.subdomain.site.co.united kingdom

site.co.united kingdom

subdomain.site.co.united kingdom

were put in the function they'd be came back as "site.co.united kingdom".

I'd say there's a regex means to fix this, but it will likely be complicated. You'll have to discover the last occurrence from the '.' and obtain what's next, then you need to get what's between your last and 2nd to last '.', then get anything prior to the second to last period, as much as the 3rd right (subdomain) '.'.

Does which make sense?? I am unsure from the regex needed, but here are a few questions about To enable you to get began...

http://stackoverflow.com/questions/1237/regex-to-pull-out-a-section-a-substing-from-a-string-between-two-tags

http://stackoverflow.com/questions/328387/regex-to-replace-all-n-in-a-string-but-no-individuals-inside-code-code-tag

http://stackoverflow.com/questions/489567/need-regexp-to-find-substring-between-two-tokens