32 comments

[ 3.0 ms ] story [ 87.7 ms ] thread
Isn't this a repost? I discovered this tool a long time ago from HN and it has been invaluable to me. I always open it up when I need to construct regular expressions..

It's my second go-to programming website, the first being devdocs.io -- which if you don't know about, you're welcome! (all the api docs loaded offline)

devdocs.io is not only a fantastic resource, but a very well run FOSS project and a pretty damn good example of a well working web-app.
Wow never heard of devdocs.io. Really cool resource for getting up and running quickly on new frameworks and languages.
For those not aware of all the alternative online regex testers out there... I prefer regex101.com because of the better color coding. I previously made a snippet demonstrating that benefit: https://news.ycombinator.com/item?id=9581225
Seconding regex101.com -- it's really a wonderful tool.
I use both for different reasons. (From memory I think one does replacements better) Both are fantastic tools. My first port of call when trapped with a tricky regex.
Likewise, there's debuggex.com too to visualize your regex.
Also regex101.com (and debuggex.com) have they're own PCRE implementation, which is really useful if you need something other than JS regexes.
Sometimes I wonder if these online tools mine data on text blobs and regex we pass in. I can only imagine how potential IP could be leaked if the data was correlated to a company that the user is using the tool from. Has anyone done analysis to see whether to tools send data back to the servers? In theory the entire app should be client side only.
I've never felt comfortable with password strength tools online for similar reasons. Sure, most (maybe all) are local Javascript, but still.
Can you not monitor networking and make sure nothing is being sent back?
Sure, but it's a lot easier to just not use 'em.
Not really, these provide much needed help.

It's like saying, I'm gonna stick to Notepad and not use a proper IDE because I'm not sure if they send the code I write back to themselves.

They probably don't but still kind of hard to be sure. In principle they could introduce it at any given time without anyone noticing for a while. Of course, once someone does notice, the shit will hit the fan.

Anyway, I share your nagging doubt and I'd never paste any text containing sensitive information into any text pane on a web page, not regexr, not JSON formatters, not anywhere.

Second that, because it supports different flavors of regex (pcre, javascript, python).

I use regexhero.net for .NET regex support.

>I use regexhero.net for .NET regex support.

So far, I've been using regex101 even for building C# .NET regex because I haven't needed Microsoft-specific behavior.

That regexhero.net is an interesting link. I would have preferred that the website built a .NET compatible engine by extracting the actual source code[1] available from Microsoft. That way, it wouldn't require using the Silverlight plugin. However, I understand why Silverlight would be the easiest way.

[1] https://referencesource.microsoft.com/#System/regex/system/t...

and may also use transpiler: https://www.google.com/search?q=C%23+to+javascript+transpile...

I think the easier solution would be simply to write your tester in one of the .NET languages...

That seems to be the approach http://regexstorm.net/tester took, at least. It's low frills (only highlights matches), but it's good for making sure that the problem really and truly isn't some weird regex quirk.

Online regex testers are nice but nothing beats RegexBuddy [1] IMO. I have fond memories of me using it while on high school to naively parse HTML using regular expressions only. Good times.

[1] http://www.regexbuddy.com/

I use Regexbuddy as well. It's awesome. I couldn't however figure out how to use Regexmagic.
Came here to promote RegexBuddy myself. It's the one thing I truly miss in my transition from Windows to Mac. I run it in WineBottler[1] now and it works well enough but I'd pay good money for a native Mac version.

1: http://jdon.at/HpTd+

i love regexbuddy. I made a similar app (regexpixie.com, windows exe) that also uses the blue-yellow coloring to differentiate between matches.

The biggest difference is that RegexPixie has really good support for named groups. Frankly, it's beyond me why people don't use named groups for regex documentation.

(comment deleted)
Not really a learning resource but more of general purpose tool which includes support for Regex searching as well as a number of other operations is: https://gchq.github.io/CyberChef/

It's got some decent built-in regex examples such as IP addresses, email addresses, dates, etc.

My favorite of these, because it's the simplest:

"As an aside, it's easy to test your understanding of regular expressions interactively: the program

  $1 ~ $2
lets you type in a string and a regular expression; it echoes the line back if the string matches the regular expression."

From the classic book "The Awk Programming Language" (https://news.ycombinator.com/item?id=13451454).

Why is this on HN? It's literally the first result you get if you Google regex.
I just started dabbling in writing a major mode for Emacs and found there is a great mode build in for testing Emacs regex. If you use Emacs, open a file and then start the mode with "M-x re-builder". You can type regex in the input buffer and see it highlighting in real time. It's pretty slick.
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

- Jamie Zawinski