FW: Eregi question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux