Hello,

From: "Nick Wilson" <[EMAIL PROTECTED]>

Does anyone have the regex to make sure an http address is full and
without error? like http://www.example.com

Usually I use this expression:

'^(http|https)\://(([-!#\$%&\'*+.0-9=?A-Z^_`a-z{|}~^?]+\.)+[A-Za-z]{2,6})(\:[0-9]+)?(/)?/'

You may also want to try this forms generation and validation class that comes with special URL auto-completion field support so you can do for instance simply type www.php.net and it automatically expand to http://www.php.net/ and conform to a more strict validation expression like the above without making the user type it all.

http://www.phpclasses.org/formsgeneration


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



Reply via email to