dan wrote:
I've been searching and am not finding a regexp to check the validity of a url.
That's probably because you have to match
foo.site.com or foo.site.co.uk or foo.site.tv but not foo.site.bar
And that's the simple approach.
To be really valid, you'll need to check for every Top Level Domain worldwide and any suffixes thay may have (such as .co) through any resistrar... and that's just asking for a little much.
But, not to send you packing empty handed...
check out the masterful art that is Friedls' take on the problem of validating email addresses.
http://public.yahoo.com/~jfriedl/regex/code.html
It contains some hardcore domain name pattern-matching... so you'd be best to use those expressions.