Regular expression validating url

There are probably dozens of way to format a phone number.

Your user interface should take care of the formatting problem by having a clear documentation on the format and/or split the phone into parts (area, exchange, number) and/or have an entry mask.

Or you can put all the possibility to show: such as (nz|uk|co|......), of which there is almost serveral hundreds.

I think it's ok to get most of url and if you want an ideal answer, it will be more complicated and there is no sense.

He also sliced up the Unicode ranges :=), that's the reason his one is so long :) = are excluded by the second validation block.

He also sliced up the Unicode ranges :=), that's the reason his one is so long :) Need to mention I took the idea of validating the possible IP address ranges in the URL while looking at other developers regular expressions I have seen in your tests, especially the one from @scottgonzales.

right now i am using this expression \.) [\w-] (/[\w- ./? which validates url like .. but i want a expression which also validate or allows net i.e wiht out ( this dint work it gave a java script error and was not validating the url the rg i am using is \.) [\w-] (/[\w- ./? i solved my problem by placing a or sign i.e ( \.) [\w-] (/[\w- ./?

regular expression validating url-84regular expression validating url-84regular expression validating url-14regular expression validating url-4

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

Note that there's just no way to check if the last portion of a path is a file or a directory just by the name alone.

You could try to match for an extension, but there's no requirement for a file to have an extension.

$_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.

) I changed it a little bit so that it's valid in Ruby.

Leave a Reply