Hacker News new | past | comments | ask | show | jobs | submit login
ReFiddle: Fiddle for Regexp testing (refiddle.com)
135 points by tilt on June 21, 2012 | hide | past | favorite | 41 comments



Would be great if there were support for more Regex types. All those supported by grep (ie. BRE, PRE, PCRE) seem fairly essential – and being a Python guy, Python would be nice too (which are PCRE-ish).

Nice work, though.


I will second a Python vote.


One more for Python


Nice work! :)

http://rubular.com is also a good one (Ruby regexes).


Rubular is great - I like their UI better than the one of the [js|re]Fiddle[s]?.


Perhaps you mean:

    (js|re)?Fiddles?


I don't know, I'm pretty fond of |Fiddle myself ;)


If you are looking for a command line regexp builder I highly recommend txt2regex. It is a giant bash script so it runs anywhere bash does and supports:

  a) +awk                                m) +mysql 
  b) +ed                                 n) +ooo 
  c) +egrep                              o) +perl 
  d) +emacs                              p) +php 
  e) +expect                             q) +postgres 
  f) +find                               r) +procmail 
  g) +gawk                               s) +python 
  h) +grep                               t) +sed 
  i) +javascript                         u) +tcl 
  j) +lex                                v) +vbscript 
  k) +lisp                               w) +vi 
  l) +mawk                               x) +vim 

http://aurelio.net/txt2regex/


I'll go ahead and recommend RegexBuddy (http://www.regexbuddy.com/) as another useful tool for testing regexes. (No affiliation, this just happens to be one of the most useful programs I've bought with my own money.)


I was gonna recommend this as well, then I saw your comment, and then I saw your username, and then it got really weird.


Don't you hate it when you make a comment through an old HN account and then completely forget about it and post through your normal HN account a quarter of an hour later?


Regexbuddy was critical for success on three Regex heavy projects I worked on a few years ago. I still have it running on an old Windows PC.


RegexBuddy is fantastic, I bought it ages ago and lost my license key thing. Also it's Windows only (boo!).


One of the few Windows apps I miss. Fantastic software.


It works on Linux perfectly via WINE. And OSX via WINE. http://www.regexbuddy.com/wine.html


My entry into this category:

http://regex.powertoy.org/

It makes use of a hidden Java applet -- so it supports the somewhat larger Java regex syntax, doesn't send your data anywhere else for matching, and can hook into the string-probing to animate the process. (Click the 'animate?' link to show the animation step/speed controls.)

For example, you can watch the regex that tests whether a number is prime (by failing) or composite (by succeeding) via these two animations:

49: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...

47: http://regex.powertoy.org/?pat=/^1%3F%24|^%2811+%3F%29\1+%24...

Is the applet requirement a deal-breaker for casual use? I might be able to feed the OpenJDK 7 regex classes through the Google Java->JS cross-compiler to get a pure-JS solution with the same syntax/animation capabilities.


I don't think its a deal breaker but if its a hidden java applet then why not have the regexes processed on the server as a servlet and sandbox them with a timeout?


That could work, but an original design goal was to avoid server dependencies or bottlenecks.

For instant display or the stepwise animation, the lag of a server roundtrip could be a problem; for some users, posting data to a remote service might introduce privacy concerns. (The regex-powertoy can be run completely locally.)


well. for some it is because they don't run java (e.g. me) but for the large population it will not matter.


I've used lots of regex tools over the years, but I stopped looking once I bought RegexBuddy.

See a demo: http://www.regexbuddy.com/demotest.html

It's a Windows program, but runs on Linux via WINE. It lets you debug regexes, has live highlighting of matched text, generates regex code in 15+ languages (Perl, Python, Ruby, PHP, C, C#, C++, Delphi, Java, Javascript, MySQL, etc) and is all around awesome.

I'm not affiliated with this program, but it is the BEST regex creation/testing program available anywhere.

It will save you oodles of time if you create (or debug) regular expressions more than 2 times in a year. It's the best software product I've ever bought with my own money.


Some other online regex tools that you may find useful depending you what flavour of regex you want to create and how proficient you are with them:

http://www.rexv.org/ — Supports: PCRE, Posix, Perl, Python, JS, Node.js modifiers. Only works online though.

http://gskinner.com/RegExr/ — Implemented in Flash. Desktop version available.

http://regexpal.com/ — Javascript regex only.


The best tools out there for regexp testing is http://gskinner.com/RegExr/ - the only flash application i've ever used


Rex V (http://www.rexv.org/) is my current favourite regex playground.


Awesome! I'm however unable to make negative lookaheads and lookbehinds work right now – though Ruby & .NET are said to support them according to http://en.wikipedia.org/wiki/Comparison_of_regular_expressio....


This regex creator is one I've used for ages; its a bit ugly but it generates the regex for Perl PHP Python Java Javascript ColdFusion C C++ Ruby VB VBScript J#.net C#.net C++.net VB.net. You type an example (or the actual) string you plan to search over, click submit and it generates a weird chart that you can use to select which bits you want your regex to find. Really advise giving it ago; no regex knowledge required and more importantly.. fast.


I too have a website that does regex testing. It supports Java, JavaScript, .Net, Perl, PHP, Python, Ruby & XRegExp, though some are more complete than others.

And it supports sharing & a cookbook too.

http://www.regexplanet.com/


For a CLI debugger/play-through have a look at Regexp::Debugger (I posted this video link yesterday - http://news.ycombinator.com/item?id=4136179)


More contrast, please. I can barely see the green matches on my screen.


I've always been a fan of Reginald (http://atastypixel.com/blog/reginald-regex-explorer/) on OS X.


I can totally recommend Patterns, with support for java, python, ruby etc

http://itunes.apple.com/us/app/patterns-the-regex-app/id4294...


I've been using RegExr[1]. It's Flash/Flex, the "Community" tab is useful for finding common RegEx's.

[1] http://gskinner.com/RegExr


I use sublime text for this. Considering how many regexes I write a day, I actually need a text editor that has this support. Don't you ? :)


No. Regexes are a hack. I don't write them every day, I write them when I need a hack to get around a problem there isn't a good solution for.


Why do you say regex's are hacks? Aren't they nice to use in order to search and replace text? It's really powerful!


Regexs are not hacks. They are part of a programmers toolchest. Just because you write them when you cannot think of a better solution doesn't make them a hack.

They are a legitimate solution for efficient text matching problems.


If you work with .NET regex, I recommend http://regexhero.net/


Very nice, please add Java and Python support, but otherwise really dig it.. the tests are especially neat.


http://www.regexpal.com/ is a good alternative too


Nice work! It sure do got a purty mouth.


Cool! Is the code open source?


You are my hero.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: