gSkinner - Home

RegExr v2: Build, Test, & Learn RegEx

Posted on March 26, 2014 by Grant Skinner

RegExr is exactly six years old today. Built in Flex and AS3, it was a largely accidental outcome of exploring a few technical concepts I was interested in at the time (tokenizers/lexers, advanced text interactions, regular expressions).

RegExr v1 circa 2008

I thought the end result might be useful to others struggling to learn or work with RegEx, so I released it online. Its popularity took me by surprise, with around 10M hits and 150K patterns saved to date. This is despite being essentially abandoned since 2008.

I’m happy to announce that the neglect is finally ending, with today’s release of RegExr v2. Rebuilt from scratch in HTML/JS, and (hopefully) improved in every way. I’d like to believe that RegExr v2 is the best way to learn, build and test RegEx online today.

RegExr v2

Key features:

  • clean, modern design
  • video tutorial
  • expression syntax coloring
  • underlines expression errors in red
  • contextual help for all regex tokens and errors on rollover
  • updates matches as you type
  • support for testing substitution/replace
  • full reference of all JS RegEx tokens, with loadable examples
  • searchable database of community submitted patterns
  • drag and drop text files to load their content
  • save and share patterns with others via direct links
  • undo/redo
     

I also dug through over 240 comments on the original blog post, and implemented a ton of suggestions:

  • larger monospaced text and support for browser zoom (my eyes are older, my monitors are larger, and 10pt font just doesn’t seem so cool now)
  • vastly improved tokenizer, that is (hopefully) 100% accurate to JS RegExp standards
  • improved documentation, now with examples
  • support for pasting full expressions (including flags)
  • save includes your sample and substitution text
     

Now that it’s released, we’re going to try not to let it stagnate again. The first order of business is to clean up the code and commit it to the RegExr GitHub repo, so that it becomes a living project with community support.

We’re also going to try to clean up the existing community patterns – likely scrubbing any that now have errors (due to differences in AS3 and JS for example).

Following that, I’m going to be taking a look at different options for wrapping it in a desktop installer, so you can run it offline and save your favourites locally (input on this is welcome). I’d also love to make it usable on mobile devices, not because I think there’s a huge demand for testing regular expressions on mobile phones, but as a challenge to see if it can be done well – I think the “click to insert” feature of the reference library could work really well.

I’m also planning to write up a blog post exploring some of the technical challenges and decisions that we made while building this.

If you enjoy using RegExr, you can help out by tweeting, facebooking, gPlussing, blogging, or otherwise sharing/linking to it so others can find it. Version 1 disappeared almost completely from Google a few months ago (I believe they downgraded pages with only Flash content), and I’d really like it to recover in the rankings.

As always, I’d love to hear what you think of the new version of RegExr, and any feedback on how to make it even better.

Follow @gskinner on Twitter for more news and views on interactive media.
24 Comments

Hey - No warning ? A client I'm at runs IE 8 on their image, and unfortunately no other browsers and I can't get to your site to do the necessary work I need to do today.

Looks like a great update though ;)

Posted by: JP on Mar 27, 2014 5:35am

@JP: tell your client they need to upgrade. XP LTS has expired and IE8 users are a very very very tiny fraction of users nowadays.

Posted by: andy on Mar 27, 2014 12:03pm URL: http://www.vas.it

Yea - we get that. I wish I had the pull in a 60,000 user company and a little security guy :) It's Win 7 though. Some corporate app they are trying to update....

Posted by: JP on Mar 27, 2014 12:05pm

@JP - when you open regexr.com in IE8, you should see a message letting you know your browser is not supported, with a link to RegExr v1 (as long as you have Flash installed). Let me know if you're seeing something else.

Posted by: Grant Skinner on Mar 27, 2014 12:12pm

it does - I love the new version - just threw me for a loop this morning. I totally encourage you to keep updating. I'm just being squeaky! Sorry mate.

Posted by: JP on Mar 27, 2014 12:46pm

Really nice, Great work! looks like I'll be switching from regexpal.

Posted by: Daniel on Mar 27, 2014 5:27pm

Good stuff G.

Posted by: John C. Bland II on Mar 27, 2014 8:53pm URL: http://johncblandii.com

That is amazing! I was still using regex v1 from time to time. Thanks for the update!!!

Posted by: Romuald on Mar 28, 2014 4:49am URL: http://www.soundstep.com

Very nice. One feature request: you need a switch to toggle the context help on/off. If you don't need it, it's somewhat distracting while editing.

Posted by: J. Peterson on Mar 31, 2014 12:36pm URL: http://www.saccade.com

What is the reason that the latest Opera (version 12.16) is not supported?

Posted by: EECOLOR on Mar 31, 2014 1:46pm

I still use RegExr 1 frequently in my work flow. However, I use the desktop version. This looks like a great update. Any chance we will see a desktop application version of it?

Posted by: Nate Chatellier on Mar 31, 2014 9:51pm URL: http://blog.natejc.com

@Nate - yes, we are currently looking at different wrappers and plan to provide a desktop version eventually.

Posted by: Grant Skinner on Mar 31, 2014 10:29pm

I like the change but would really like to get rid of the menu on the left side, it just takes up too much space and is distracting to the focus which should be the editor. Thanks for all the time and energy in the software.

Posted by: travis on Apr 1, 2014 10:23am

Nice, looks and feels great!

Request: please keep the older Flex based one around... as much as v2 is awesome, when I've needed a RegExp in AS3 land RegExr became my goto because it uses the AS3 Regex engine, so I knew what I saw is what I got. When doing Regex for JS there are lots out there, but RegExr v2 is top-notch and most welcome for JS work.

Cheers.

Posted by: Aaron on Apr 1, 2014 2:59pm URL: http://abeall.com

What a great project. Learning regular expressions is easier than ever. I would like to suggest some new features. After saving a regular expression and sharing it with the community it would be nice if I could edit it again. I know that you have 24 hours to update it in the database.

Posted by: Harris on Apr 1, 2014 10:57pm URL: http://www.polyptychon.gr/

Looks great. May I ask why the dotall (s) flag was not included? as it proved useful for me in the past.

Posted by: adl on Apr 4, 2014 4:55am

@Harris - you should be able to update your pattern for 24 hrs. After that, you will have to save it as a new community pattern. This is to prevent issues with people favouriting a pattern that works for them, then having it break for their use case when it is edited.

@adl - Unfortunately, dotall is not supported in JS. Instead you have to use a [\s\S] set. [^] also works for all modern browsers, but unfortunately not for older versions of IE.

Posted by: Grant Skinner on Apr 4, 2014 10:13am

trying to compile, weird it says compass not found, when its installed, not sure anyone else is getting this error on grunt build

Posted by: Chris McCoy on Apr 6, 2014 8:25am

@Chris - did you run npm install?

Posted by: Grant Skinner on Apr 8, 2014 9:15am

yes, that part went without a hitch, the grunt build part is where it errors out.

https://gist.github.com/chrismccoy/b3d0af4e1bb60bb07f1b

Posted by: Chris McCoy on Apr 8, 2014 9:29am

Hello, if there a chance to do it multi language.

I like to see this in Spanish. I can help with the translation.

Posted by: paconaranjo on Apr 21, 2014 12:31am

Great! Thanks!

Posted by: Alexander on May 21, 2014 3:24pm

Good to see a new version! I've been using v1 desktop version for a long time now as part of my coding work routine, so I'd love to see this new one as a desktop app!

Posted by: MrLewk on Aug 1, 2014 5:21am URL: http://webbosswebsites.com

Just wanted to leave a small comment to say a huge thank you for such an amazing tool. I use it all the time for my regex needs. It's fast, responsive, smart and very well designed. Kudos to you and thanks for making it open source as well.

Cheers

Posted by: Nick on Aug 3, 2014 10:06pm URL: http://nicolasbize.com

Leave a Reply

Your email is never published nor shared.




You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>