News for hackers. Stuff that matters.
Re:Regex generator: Give sample text, look for known pattern... by stevejohnson on Saturday January 22, 2011 @12:49AM (#2130045)
Weird, I had a project doing this exact same thing, just not as far along and not very well documented. I never actually had a use for it, just thought it was a cool problem. I had a nice functional algorithm for doing it. (Again, not documented except through some graphviz output.)

Seeing this, I may stop working on it.

https://github.com/irskep/t-reg

Re:Regex generator: Give sample text, look for known pattern... by riffraff on Saturday January 22, 2011 @03:39AM (#2130185)
I believe I once ripped off your code :)

I have a simple script that looks in my logs for timing reports like

   did X in 12345ms
   Z for <arandom non constant string> in 98765ms
and then summarizes them, but the grouping is done based on ad hoc regular expressions. The obvious next step was trying to make it smart enough that it recognizes similar lines and generated the patterns itself, but avoiding making it over generalized/omnicomprehensive. I still cannot find a good solution :(