FW: Eregi question
| From: | Beauford | Date: | Mon, 15 Jan 2007 19:31:25 +0000 |
| Subject: | FW: Eregi question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-247110@lists.php.net to get a copy of this message | ||
Hi,
Hopefully this is my last question so I can put this site to bed. Is there a
good article that explains how to do the patterns for eregi.
I have read tons of articles, but none really explains what everything
means. Like why some things have square brackets and some have round, what
does the * and $ do? Etc.
i.e.
"^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{1,})*\.([a-z]{2,}){1}
$"
The problem I am having is I'm trying to create a small function to validate
a web address.
i.e. www.site.com (no http://).
I have tried "[a-z0-9]+.[a-z0-9]+.[a-z0-9]", but it only works partially. If
I input www.bob I get an error - www.bob.com I get no error, but it doesn't
stop. www.bob.com.bob.bob.bob also produces no error. How do I stop it after
it matches the 3 patterns?
Thanks