News for hackers. Stuff that matters.
Re:Generate Regex from Examples by captn3m0 on Saturday July 25, 2015 @06:33AM (#9947184)
I've been looking for tools that would help me do this. Are there any interesting datasets that you have converted to regexes with this?

Zipcodes would be something I'd like to see available as regexes.

Re:Generate Regex from Examples by aaronem on Saturday July 25, 2015 @06:41AM (#9947188)
I can't load the site, so I'm not sure exactly what it's offering, but I'm also not sure what you mean by a regex for zipcodes. Surely it'd be simpler, quicker, and more maintainable just to match /(\d{5})/ and filter out invalid codes after the fact?

(Edit: If you want the full ZIP+4 where it's given, you can add (\-\d{4})? as a term in the regex, and you can validate them the same way. USPS also offers an API for validating address information; it's been some years since I used it, and I recall it being somewhat recondite in the fashion of most .gov APIs, but it's there and it works.)

Edit again: OK, the site loaded. It looks like a tool for generating regexes via machine learning techniques to match highly complex targets. From a purely technical perspective, that sounds really neat -- but from a maintainability perspective, it sounds like even more of a nightmare than complex regexes usually are.

Re:Generate Regex from Examples by ftarlao on Saturday July 25, 2015 @09:39AM (#9947541)
The site has gone down, once for a power outrage and another time cause the traffic peak... I think the problem are solved now. :-)
Re:Generate Regex from Examples by aaronem on Saturday July 25, 2015 @11:23AM (#9947815)
> power outrage

I like that!

Re:Generate Regex from Examples by ftarlao on Sunday July 26, 2015 @12:18PM (#9951424)
Auch! my fault, it sounds like but it is not :-)
Re:Generate Regex from Examples by atomwaffel on Saturday July 25, 2015 @07:30AM (#9947271)
The GeoNames Country Information table has a "Postal Code Regex" column that you might find interesting: http://download.geonames.org/export/dump/countryInfo.txt
Re:Generate Regex from Examples by aaronem on Saturday July 25, 2015 @08:15AM (#9947357)
Some of those regexes are terrifying. Granted that I'm not sure there is any better alternative for extracting structured address information from an unstructured source, but...