Regular expression for validating a url

$_iu S I have added simple network ranges validation, the rules I used are: - valid range -, network adresses above and including are reserved addresses - first and last IP address of each class is excluded since they are used as network broadcast addresses since I don't think this is worth implementing completely in a regular expression, a following pass should exclude the Intranet address space: - - 1.255 - the loopback and the automatic configuration address space: - - while the local, multicast and and the reserved address spaces: - (SPECIAL-IPV4-LOCAL-ID-IANA-RESERVED) - 239.255.255 (MCAST-NET) - (SPECIAL-IPV4-FUTURE-USE-IANA-RESERVED) should already be excluded by the above regular expression.

regular expression for validating a url-87regular expression for validating a url-20

:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )*(?

One needs to check if the entered URL for a Form matches the semantics for URLs or if a entered URL is valid, for example if your App allows user accounts, etc.

Matching URLs is also a great practice for learning Regular Expressions.

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, 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.