how can i validate a field for a valid URL?? is ther any naming
conventions for it?
Same as for your question about identifying the IP address.
You can check again a regex (there are many already done out there).
A good starting point is:
Except that a regular expression which accepts all syntactically
valid URL's, and rejects all syntactically invalid ones, is far
from trivial; the one you cite, for example, will reject a lot
of legal URL's ("news://comp.lang.c%2B% 2B", for example:-), and
accept a few illegal ones (e.g. "www."). I pretty sure it can
be done with a regular expression, but it will take a bit of
work to get it right. (Note too that different types of URL's
may have slightly different syntax. If the protocol is
"mailto", for example, a '@' is required at one point, whereas
if it is "http", one may not appear unless quoted somehow (e.g.
"%40").
--
James Kanze (GABI Software) email:james.kan ze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Comment