Anyone have a URL String Validation Routine ?
Posted: Sun Aug 18, 2002 6:55 pm
Hi guys, this question is similar to my other one about validating Email addresses.
To tell you the truth, I can only half-understand the:
$pattern = "/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/";
in the preg_match() routine.
I'm trying to decipher it but it is so cryptic.
How about a routine that can see if a string starts with 'http://', and has at least one '.' in it (and not at the very end or right after the 'http://') ?
Then I think I can figure it all out.
Thanks.
To tell you the truth, I can only half-understand the:
$pattern = "/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/";
in the preg_match() routine.
I'm trying to decipher it but it is so cryptic.
How about a routine that can see if a string starts with 'http://', and has at least one '.' in it (and not at the very end or right after the 'http://') ?
Then I think I can figure it all out.
Thanks.