xariton
05-03-2005, 03:48 PM
Here you can ask anything about regular expressions.
They can be very useful sometimes. But not everybody know them good :)
So just ask - I'll help
Yahook
05-04-2005, 09:59 PM
Hello Xariton :wink:
Do you have any expression to check if html address is valid? Please post it here.
xariton
05-05-2005, 08:01 AM
^(ht|f)tp(s?)\:\/\/[a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+){2,
}(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$
Cheap and cheerful URL checker. Requires a http/https/ftp at the start and will then allow anything starting with at least a <something>.<something>.<something> then valid characters separated by dots and slashes
Or more complicated
^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com
|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk |ru)(\:[0-9]+
)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$
Matches: [www.blah.com:8103], [www.blah.com/blah.asp?sort=ASC], [www.blah.com/blah.htm#blah]