Click to See Complete Forum and Search --> : Regular expressions
Hi,
Does anyone have a nice regular expression for e-mail address and other for url?
any help would be very appreciated :)
You mean for validating an email address? Also, what exactly do you mean "for URL"? (I know what a URL is, but I am wondering what you want to do with it, as well. Validate?)
[J]ona
If you mean validating, Jeff Mott has created an excellent regexp based on the RFC822 standard at http://forums.webdeveloper.com/showthread.php?s=&threadid=9604#post49397 and something like this regexp can be used to validate URLs...
/^(http(s?):\/\/|ftp:\/\/{1})((\w+\\.)+)\w{2,}(\/?)$/i
Yapp, that's what i meant; email and url address validation :)
Thanks Pyro.. I had one regex for mail address validation i made myself; although i knew it was poor i didn't knew it was that far from a real one. :p i'll try it ;)
TIA
I posted the code for a basic url validation scheme above...
heheh yupp yupp my mistake
;)