News for hackers. Stuff that matters.
Re:Regex generator: Give sample text, look for known pattern... by julian37 on Saturday January 22, 2011 @01:30AM (#2130084)
Headache-relieving maybe, but also eyesore-inducing.

Some simple, good advice for choosing color combinations is that in terms of HSB, never vary more than two aspects of a color. That is, you can vary hue and saturation, but then don't vary brightness. Or, vary hue and brightness, but leave saturation constant. Or vary saturation and brightness for the same hue. This is simplifying matters a lot but it's a fairly good starting point.

There's also this awesome site: http://colorschemedesigner.com/

Re:Regex generator: Give sample text, look for known pattern... by rue on Saturday January 22, 2011 @05:25AM (#2130257)
It really isn't that difficult for a programmer to learn how regexps work and construct your own rather than relying on fragile tools.
Re:Regex generator: Give sample text, look for known pattern... by henrikschroder on Saturday January 22, 2011 @06:11AM (#2130282)
Agree, I wouldn't use that or any other tool to construct regexps, but I am using http://www.regexbuddy.com/ to test, debug, and refine the ones I've made.
Re:Regex generator: Give sample text, look for known pattern... by npongratz on Saturday January 22, 2011 @11:35AM (#2130578)
I use http://gskinner.com/RegExr/ for similar reasons; it's free (doesn't even have ads), though not as powerful as RegexBuddy. Allows for a very quick test-debug-refine cycle, making clear what is matched with realtime highlighting. I'm not affiliated in any way, just very happy with the service.
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 :(
Re:Regex generator: Give sample text, look for known pattern... by dlsspy on Saturday January 22, 2011 @01:01AM (#2130061)
That's kind of neat. There were a bunch of web-based clones of "M-x regexp-builder" out there for a while. This is the first one that actually looks like it does something more interesting.
Re:Regex generator: Give sample text, look for known pattern... by alttab on Saturday January 22, 2011 @10:35AM (#2130503)
The feature that auto identifies IP addresses from valid input examples and uses a well known IP address regrex could save you some time.
Re:Regex generator: Give sample text, look for known pattern... by DTrejo on Saturday January 22, 2011 @01:29AM (#2130083)
:) glad you found my post helpful, where I mention it

http://news.ycombinator.com/item?id=2129839

Re:Regex generator: Give sample text, look for known pattern... by mbesto on Saturday January 22, 2011 @05:28AM (#2130259)
Awesome! Great for someone who is just starting out programming and has a hard time conceptualizing regex.
Re:Regex generator: Give sample text, look for known pattern... by stettberger on Saturday January 22, 2011 @04:33AM (#2130224)
Hm, yeah Regular Expressions are great, but they are also fragile and slow. The generator will, from what I se only generate very strict regexes, that will break if the input differs just a little bit.
Re:Regex generator: Give sample text, look for known pattern... by chli on Saturday January 22, 2011 @08:55AM (#2130396)
I use that to generate my regular expressions and test them :

http://www.ultrapico.com/Expresso.htm