News for hackers. Stuff that matters.
Re:Stop validating email addresses with your complex regex by opminion on Thursday September 06, 2012 @05:11PM (#4486270)
12345 could be a valid postcode in Germany or Spain, but in the UK it would have to look like AB1 2CD, except when it doesn't (e.g. AB12 3CD). Arg!

I wish web forms had a "Tell us we are wrong" button next to validated boxes.

Re:Stop validating email addresses with your complex regex by hcarvalhoalves on Thursday September 06, 2012 @05:36PM (#4486403)

    I wish web forms had a "Tell us we are wrong" button next to validated boxes.
You know... that's a very good idea actually.
Re:Stop validating email addresses with your complex regex by naww on Friday September 07, 2012 @04:18PM (#4491000)
I've been thinking about service that injects some lines of javascript for client sites that gives them button "fix this". It would send warning email after few messages about typos but it could also be used to fix these kind of things. Not sure how JS could handle selection and button press simultaneously. Maybe copy+paste part of page with fix. Maybe get some reward for being grammar nazi. Maybe some paid service for auto checking if corrections are accurate and auto-inject corrections to sites.

What the heck, how can I take MS Word online?

Re:Stop validating email addresses with your complex regex by kintamanimatt on Thursday September 06, 2012 @07:33PM (#4486877)
There's also the problem of "validation rot" in which validation functions can be correct today, but might not get updated if the data format changes.
Re:Stop validating email addresses with your complex regex by mike-cardwell on Friday September 07, 2012 @05:31AM (#4488284)
FWIW, UK postcodes have a very strict and well defined format:

https://wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#F...

Also, something not many people know is that any postcode in the UK has a maximum of 100 addresses in it.

You can tell I've been writing a search algorithm for UK address data recently ;)

Re:Stop validating email addresses with your complex regex by archangel_one on Friday September 07, 2012 @08:46AM (#4488743)
I'd like to think that's not rare enough for websites to have assumed they were always six characters - half of London lives in postcodes like "N1 2BC". The bigger problem I've found with postcodes was sites insisting on five digits, or even insisting on postcodes at all - not every country uses them!