News for hackers. Stuff that matters.
Re:RegExr: A website for interactive regex prototyping with ... by ddebernardy on Thursday May 21, 2015 @03:48AM (#9581462)
You can only validate a zip code, a phone number, an address, or an email address using a regex up to a point.

There are too many dispartities from a country to the next for the first three to hope validating anything withhout a bunch of false negatives. Some countries don't have zip codes.

For emails, blindly following the RFCs yields a monster (see [1]), and it won't help you if you run into oddball email addresses that are not RFC-compliant but work regardless due to technical implementations (or vice versa).

http://regular-expressions.mobi/email.html

There are no comments on this comment yet.