Re:A Liberal, Accurate Regex Pattern for Matching URLs
by cschneid on Friday November 27, 2009 @08:19PM
(#964647)
I like soft validation for emails. "This doesn't look like an email address, verify you typed everything correctly, and resubmit". That way you handle legit typos, without hassling people who have weird emails (gmail plus signs and such).
Re:A Liberal, Accurate Regex Pattern for Matching URLs
by notauser on Saturday November 28, 2009 @05:41AM
(#965024)
I'm actually use it to find addresses in text, for validation I usually use in the Django built in which is very liberal.
Incidentally this does correctly pick up UK e-mail addresses (tested with .co.uk .org.uk and .net.uk).
The rules are so flipping complicated and so easy to get wrong that you're better off just trying to send a mail and seeing what happens, and asking the recipient to validate reception if you care about the address. Is it really that important to exclude bad emails, at the cost of, say, blocking email addresses from the UK, as your regex seems to do? Even "validating" for sheer user error is only useful if you get it right.