I have a standard URL e.g.
http://www.test.com/test1/test2.html
I am using javascript in riak for map reduce and would like to only extract http://www.test.com. So…the domain and the subdomain.
What is the most efficient method to do this in js since I will have millions of records?
Thanks
Look at this answer: https://stackoverflow.com/a/8498629/623400
Sophisticated domain matching is kinda tricky, but all this is covered quite well in the linked post.