Hacker News new | past | comments | ask | show | jobs | submit login
Regex generator: Give sample text, look for known patterns, gives a regex (txt2re.com)
116 points by xtacy on Jan 22, 2011 | hide | past | favorite | 12 comments



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/


It really isn't that difficult for a programmer to learn how regexps work and construct your own rather than relying on fragile tools.


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.


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.


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


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 :(


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.


The feature that auto identifies IP addresses from valid input examples and uses a well known IP address regrex could save you some time.


:) glad you found my post helpful, where I mention it

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


Awesome! Great for someone who is just starting out programming and has a hard time conceptualizing regex.


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.


I use that to generate my regular expressions and test them :

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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: