With all these new rules one stays the same: An TLD is minimum 2 characters, so we need to match for that.
Regular expression for validating a url who is tavis smiley dating
Now comes the hard part: We need to match different types of domains since there are at least 5 schemes of protocols that are valid, simply put: match set up, let's add the www part.
We will create a Java Script Object to store the different parts of our Reg Ex to keep a better overview.
In this pen you can see the things that are matched (green) and the original URLs (grey). The Dot needs to be escaped because otherwise it would match every character (Reg Ex with . This rule, however, doesn't fit anymore since the new TLDs are "real" words such as and so on. See the Pen Reg - Match URLs (Part 3) by Kevin Gimbel (@kevingimbel) on Code Pen.
A list of new TLDs can be found on gandi.net, a registrant and hosting company. See the Pen Reg - Match URLs (Part 2) by Kevin Gimbel (@kevingimbel) on Code Pen. You can find every pen created for this Blog in the collection at Code Pen.
I'd like to let through URL's without the protocol specified (HTTP(S) or FTP). @nghuuphuoc, the regexp already supports international URLs, just write them using natural UTF-8 encoding.