RegExr is an online tool for editing and testing Regular Expressions (RegExp / RegEx). It provides a simple interface to enter RegEx expressions, and visualize matches in real-time editable source text. It also provides a handy RegExp snippet sidebar with descriptions and usage examples to make it easier to learn Regular Expressions through trial and error.
It isn't as powerful as a product like RegExBuddy, but it has the advantage of being online and free. I will be releasing a free desktop version for Mac OSX and Windows built with AIR in the next day or two.
So far this has only taken a day of development, and the main app is only 150 lines of code. Flex 3 makes this kind of app so darn simple to put together.
RegExr is built with Flex 3, and uses ActionScript 3's built in RegExp engine. As with most engines, the AS3 RegExp implementation isn't perfect, so you are likely to encounter some limitations and oddities. Likewise, RegExr is very much beta software (did I mention it was developed in a day?), and currently has no error handling whatsoever, so it'll probably have a few quirks of its own.
RegExr uses an extension of the TextHilighter class that comes with the Spelling Plus Library. We will be including the RegExpHighlighter class with a future release of SPL.
If you encounter any issues using RegExr, would like to request a feature, or have a snippet you'd like to see added to the snippets pane, leave a comment below.
Here's a quick screen shot of RegExr in action.

The latest version of RegExr will always have a permanent home at: gskinner.com/RegExr/. Flash Player 9 is required. I hope this is useful to people!
Update Mar 27, 08:
0.1.2b is online. Please click here to read about the update.
Update Mar 31, 08:
0.1.4b is online, and the desktop version of RegExr is now available. Please click here to read about the desktop version.
Update Mar 31, 08 (2):
0.1.5b is online, with support for replace functionality.
Update Apr 1, 08:
0.2.0b is online. I wrote a simple RegEx lexer for this version, so it understands your expressions at the token level. It still has a couple of minor quirks (character ranges with escaped characters is the main known issue [\x41-\x48] ).
Update Apr 2, 08:
0.2.1b is online. It addresses issues with character ranges and escaped characters, and includes some minor UI tweaks. Click here for more info.
Update May 26, 09:
0.3b is online. It allows you to save, share, search, and rate patterns. Click here for more info.
Comments (63)
Very useful tool! Thanks.
Posted by: Kyle at March 26, 2008 02:08 PMURL: http://flexmonkeypatches.com
I made a similar application a while ago, you can see it at http://blog.idsklijnsma.nl/regular-expression-tester-v10/
It has code highlighting and you can test with replace functions.
Posted by: Ids at March 26, 2008 02:18 PMURL: http://www.idsklijnsma.nl
Useful, thanks!
Posted by: Nate Chatellier at March 26, 2008 02:20 PMURL: http://blog.natejc.com
Grant, this is very cool. Super useful, and I like the didactic aspects of the UI.
One thing that would be useful would be to have an 'auto-execute' mode/checkbox so that you could see the matches change on every keystroke in the TextInput.
Posted by: Daniel Wabyick at March 26, 2008 03:40 PMURL: http://www.wabysabi.com
Ids - nice work! I started writing a lexer, but didn't finish it in the one day limit I gave myself (I'm currently procrastinating about doing my FitC slides). I hope to add similar functionality soon.
Daniel - definitely in my plans. I just need to handle exceptions properly first. I don't want the browser to crash because of a malformed expression.
Posted by: Grant Skinner at March 26, 2008 04:01 PMURL: http://gskinner.com/blog/
I have been using this, pretty cool:-
http://osteele.com/tools/rework/
Posted by: Abdul Qabiz at March 26, 2008 11:05 PMURL: http://www.abdulqabiz.com/blog/
Hello Grant. Just wanted to inform you that your regex tool came in very handy when I most needed it. Thanks for your effort.
Posted by: William from Lagos at April 2, 2008 04:52 AMURL:
Doubleclicking text in the pattern field seems a bit off. Can't put a finger on exactly what, tho :)
It would be nice to have some sort of hierarchical doubleclick action. I.e. first select a group, then a component of the group and last the set or quantifier of the selected component.
Posted by: Magnus at April 3, 2008 02:14 AMURL:
Great tool, there's nothing worse than trying to do ReGex without a scratch pad to work out whether they work okay or not - that's just what this is. I downloaded the Adobe AIR version and will use it regularly, I guarantee.
Posted by: Mark Benson at April 10, 2008 01:37 AMURL: http://markbenson.org/blog
Hello, nice tool. It will be nice to see it on Russian. Can I help you to translate?
Posted by: TermiT at April 10, 2008 11:17 AMURL: http://blog.termit.name/
In the desktop version it would be nice to be able to save your expressions, perhaps along with the examples to the right.
Posted by: tan at April 14, 2008 11:19 AMURL:
Thanks for the great job you have done. That is one "kick-ass" tool. Thanks again.
Posted by: kerem at April 14, 2008 11:24 AMURL:
Hi this is great, RegEx expressions can get way confusing, but your app sure makes things easier. If I may ask for your advice though via an example-
If I wish to strip bracket characters such as * () [] "" etc from a string using one RegEx pattern, what would the RegExp look like? I can successfully replace one at a time with your tool, using \* but if I add something like \*\( it doesn't replace anything.
Thanks, really great AIR app as well.
Posted by: JP Venter at May 3, 2008 02:43 PMURL:
Sorry it is me again, with regards to my last post about the mutliple replace in one RegExp, I have the solution which you may like to work into your next release.
To replace * and () in one expression use:
/(\*|\(|\))/gi. Perhaps when a further expression is added via your app you could somehow insert the | and enclosing brackets to make the replace work.
Thanks, JP.
Posted by: JP Venter at May 3, 2008 03:20 PMURL:
Hello Grant,
Excellent initiative! I'm looking forward to using it!
Posted by: Cedric M. (aka maddec) at May 8, 2008 10:41 AMI've tested sofar:
Expresso Regular Expression Development Tool
by Ultrapico. It is pretty advanced (too much ?) and might be inspiring for your own tool?
URL: http://analogdesign.ch
Hi Grant,
Thanks for putting this out there! After a couple years of false starts, it's really helped me finally figure out regular expressions. I would like to second tan's suggestion to add the ability to save patterns to the sidebar in the AIR version.
Posted by: Daniel Williams at May 16, 2008 12:29 PMURL: http://www.themathiseasy.com
Air version needs unrestricted access to computer ???
Posted by: xavi at May 20, 2008 03:39 AMWhy?
URL:
There is no option to copy the matched result.
Thanks
Posted by: Florin at June 3, 2008 04:17 AMURL:
Very handy tool, but it showing the text as like whole pattern matching, while explanation showing right things.
Try this RE:
\b((?:http|ftp)://[^\s\"\']\S+?)(?:[\,\.\|\)\>\'\"]?(?:\s|$))
And any text that contains URL's. It should match URL right after it's end, before any dots, pipes, quotes etc.
Explanation is right:
RegExp: /\b((?:http|ftp)://[^\s\"\']\S+?)(?:[\,\.\|\)\>\'\"]?(?:\s|$))/gi
pattern: \b((?:http|ftp)://[^\s\"\']\S+?)(?:[\,\.\|\)\>\'\"]?(?:\s|$))
flags: gi
1 capturing groups:
group 1: ((?:http|ftp)://[^\s\"\']\S+?)
But I just spotted a minor error.
Posted by: AnrDaemon at June 4, 2008 10:04 AMIn
RegExp: /\b((?:http|ftp)://[^\s\"\']\S+?)(?:[\,\.\|\)\>\'\"]?(?:\s|$))/gi
It should either select alternative chars to mark start-stop (i.e. # or !), or escape "//" in middle.
URL:
AnrDaemon,
I'm not sure I understand the issue. There is a possible problem with your expression, in that it matches characters at the end it probably shouldn't. Notice below I have changed the trailing non-capture group to a forwards look around instead.
\b((?:http|ftp)://[^\s\"\']\S+?)(?=[\,\.\|\)\>\'\"]?(?:\s|$))
You did make me notice a problem with my RegExp Lexer where it doesn't deal with escaped closing brackets properly. I'll try to fix that.
Posted by: Grant Skinner at June 5, 2008 09:07 AMURL: http://gskinner.com/blog/
Very cool tool. It would be great if it is able to generate code like php, perl and C#. Check out this online tool (http://www.techeden.com/regex). It can generate php code. This feature is really useful.
Posted by: Adam at July 16, 2008 11:47 PMURL:
I found a small bug:
If you enter a positive lookbehind (?
Other than that it's a simply amazing tool!
Posted by: grapefrukt at July 18, 2008 07:31 AMURL: http://grapefrukt.com/blog/
hi. great tool to play around with :)
but i'm running in some problems/questions here: i'm trying to get the text between two html-tag - without the tags!
<a href='asdasd'>text</a>
should return "text"
i'm not so much into regex - the one i'm trying is:
(?<=<a.*?>)(.*?)(?=</a>)
or
/(?<=<a.*?>)(.*?)(?=</a>)/gi
hope this'll show up correctly in the browser ..!?
maybe someone can help me ... what am i doing wrong. or is the positive lookbehind not working properly?
thanks, phil
Posted by: philipp at August 18, 2008 07:20 AMURL: http://www.beta-interactive.de
Phil - have you tried using the snippet to do this from the samples list (in the right side bar)? It's the second one from the bottom in that list. You may have to tweak it for your specific needs, but it handles the example you posted nicely.
Posted by: Grant Skinner at August 18, 2008 10:31 AMURL: http://gskinner.com/blog/
thanks grant ... didn't see that one ;)
Posted by: Philipp at August 19, 2008 03:46 AMwill try to change the snippet to my needs.
URL: http://www.beta-interactive.de
Thank you a lot Mister Skinner!
Posted by: agnostik at September 1, 2008 01:43 PMThe only thing it lacks is the ability to show the text and regExp that were in the fields at the moment when I close the app.
I hope there will be such a feature in the next version (if there's going to be one) :)
URL: http://agnostik.com.ua/
Great app! Thank you Mister Skinner.
It only misses one thing - the ability to remember the content of the fields which were just before I close the app. It's a bit annoying to paste the text and regExp each time you start a work with it.
Posted by: agnostik at September 2, 2008 03:04 AMURL: http://agnostik.com.ua
This is an amazing tool! Thank you a lot Mister Skinner.
The only thing it lacks is the ability to "remember" all the texts there were in the fields just before the app is closed.
Posted by: agnostik at September 4, 2008 03:23 PMURL:
Unrestricted for AIR version?
No thanks.
Posted by: Fred at September 11, 2008 11:47 AMURL:
Fred,
This is a standard message on the AIR application installer. It merely indicates (in a rather dramatic way) that it will have the same access to your system that any other desktop application has. Adobe just feels the need to warn you about it, whereas other desktop application installers do not.
Cheer, Grant.
Posted by: Grant Skinner at September 11, 2008 11:49 AMURL: http://gskinner.com/blog/
i was writing yet another regex at work today utilising this app which reminded me what a great user experience it provides integrating the logic development, syntax checking, and case testing into a single clean interface! very "regexbuddy" lite ... if only there were a version for e4x ;)
Posted by: Jon Toland at September 16, 2008 12:42 AMURL:
I've been using RegExr for a while and just have to say Thanks! It is awesome.
- Rory
Posted by: Rory at September 24, 2008 03:28 AMURL:
Great tool Grant - thanks
Posted by: David at September 30, 2008 04:10 AMURL:
Hi Grant,
I've been a fan of your work for quite some time now.
Earlier this year, I was doing lot of regular expression work and upon searching the web, I didn't find any good tools (this was before you posted regexr). In February I began building an application to rapidly create Flex regular expressions in a similar style to the 'Explorer' applications that exist for Styles and Components.
I had it 95% complete by May, but had to put it on the back burner. Later in the summer, a friend of mine sent me a link to your application which I have found to be a quality tool, as I certainly expect from you. But it has some different feature sets to the tool I was building, so I recently was able to wrap mine up and posted it yesterday.
It is called the Flex 3 Regular Expression Explorer and can be found at my blog:
http://blog.ryanswanson.com/2008/10/introducing-flex-3-regular-expression.html
I felt that providing an interpretive environment for rapidly creating regular expression was a great base feature set, but I really wanted people who don't understand regular expressions to be able to get involved, so I added a full-featured contextual help panel. I also wanted to provide some basic examples that I came up with but also allow anyone else who uses the tool to be able to contribute their own creation as well to the community. When we all work together, we all profit, etc.
Anyhow, I just wanted to send you a quick note and mention what a fan I've been of your work and to see if you had any feedback for the application I just released.
Cheers,
Ryan
See you at MAX!
Posted by: Ryan Swanson at October 18, 2008 10:08 PMURL: http://ryanswanson.com
grapefrukt, philipp - yes, there's a look behind behavior bug in EcmaScript 3 RegExp. This issue was committed to Adobe JIRA:
http://bugs.adobe.com/jira/browse/ASC-3399
and then has been marked as external and redirected to Mozilla's Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=445815
This doesn't help us in solving the problem, but at least we know what's the root of the wrong behavior.
Posted by: Rostislav Siryk at November 10, 2008 12:38 PMURL: http://en.flash-ripper.com/
What regexp dialect is this for? Ecmascript's?
Posted by: glbl at November 10, 2008 05:00 PMURL:
Regexr is a great tool, thanks for putting it together. Any change you could actually show the different groups captured? Thanks!
Posted by: Nick at November 21, 2008 12:59 AMURL:
Nick - if you roll over a match highlight (the blur round rectangles), it will dispay a tooltip showing the captured groups. Is that what you needed?
Posted by: Grant Skinner at November 21, 2008 08:34 AMURL: http://gskinner.com/blog/
I just wanted to say thank you! this is an awesome tool and has helped me learn Regular Expressions.
Posted by: tanner at December 16, 2008 03:57 PMURL: http://www.cabedge.com
regexr is great, but I noticed some inconsistencies when using the expressions in javascript on other browsers... so, I developed a similar tool that is native to javascript on the browser it is running... check it out (see my link)
www.cyber-reality.com/regexy.html
I hope this helps others too.
Posted by: chad at December 19, 2008 08:00 AMURL: http://www.cyber-reality.com/regexy.html
I don't know where to report the problem, so lets do it here...
The entry field to enter the regex takes the AltGr key into account as if it was a character key, so that when I type "AltGr+(" to get the character "[", the field will contain AltGr[ while AltGr stays invisible. I correct this by going one letter back and typing backspace.
This is, under Linux with the Linux Flash version 10.
Posted by: Mike at January 14, 2009 01:52 PMURL:
Thanks so much for this. This editor is invaluable.
Posted by: Holger at January 21, 2009 03:43 AMURL: http://hmatthies.com
Two bugreports and one request:
- lookbehind is displayed as lookahead (highlighting help textwhen hovering over the regex part)
- When matches are displayed, hovering over the match will show information about it. But it is impossible to click the match to position the cursor there.
+ Please allow oldschool keyboard shortcuts (CTRL+Ins = copy, Shift+Ins = paste, Shift+Del = cut).
Using Opera 9.5 on Vista.
Posted by: Holger at January 22, 2009 08:41 AMURL: http://hmatthies.com
I'm running a GNU/Linux x86_64 and I've got this error while trying to install the desktop version :
"This application requires a version of the Adobe Integrated Runtime (AIR) which is no longer supported. Please contact the application author for an updated version."
Plus, as posted above, I've got an additional character when using AltGr : "" (char code 0x03)
Posted by: Avétis KAZARIAN at March 5, 2009 12:35 PMURL:
For the "additional character" it seems to be a problem with encoding : I've got some "é" etc. when trying some latin characters.
Anyway, the tool works fine.
Great job.
Posted by: Avétis KAZARIAN at March 5, 2009 12:54 PMURL:
Find ich echt Super! Gute Arbeit.
Posted by: private at March 25, 2009 05:19 AMURL:
Hey Grant. Great plugin, and especially great UI. I'd like to suggest one improvement: It would be great if your app also translated expressions into the proper regex syntax for various languages. I tried one of the other tools listed in these comments located at: http://osteele.com/tools/rework/ and I was able to solve a problem that had plagued me for hours because I (a designer not developer) had no idea I was using improper syntax. RegExr is such a great teaching tool, this seems like it would be a perfect addition.
Again, great app.
Posted by: raafi at March 30, 2009 02:51 AMURL: http://raafirivero.com/blog/
Hey Grant. Need a save faechure
and nice to see online loading and saving users regexp's
its easy to do and very helpful for endusers...
waiting for updates
Posted by: Flop at April 4, 2009 06:33 AMURL: http://bafpug.com
How about unicode support in this app?
Posted by: Melnaron at April 11, 2009 07:29 AMURL: http://melnaron.net
Excellent tool. After hours of trying to get my regular expression syntax correct and failing, I searched for a regex tool and found yours.
It is great!
Posted by: Andrew at April 30, 2009 07:13 AMURL: http://www.youtubekeep.com
Awesome! And all the other goodies mentioned in the comments too - a RE Bonanza! Would be excellent if I could save my expressions to the APP. Would be super if input box supported Undo.
Posted by: john at May 9, 2009 07:05 PMThank You!
URL: http://www.webdeveloperss.com/
Hiya again.
I already wrote to thank you for this cool tool. A request, if you ever revisit it: an option for a considerably larger font size. On my Mac, the text is VERY small for my aging eyes, and I guess, since it's Flash, I can't change the text size as I do for regular web pages. Thanks!
Edly
Posted by: Edly at May 11, 2009 06:21 AMURL: http://edly.com
Super! I'm using the web-application for a while now. Maybe a nice icon would make the lot a bit more nicer, no? ;)
Posted by: donotfold at May 27, 2009 06:06 AMURL: http://www.donotfold.be
Hey Grant, very nice and usefull app, but could you please implement and auto-update version and maybe a small nice icon, a little bit easier to recognize on a Mac in a folder.
Posted by: Joey at May 27, 2009 06:37 AMJust a tip!
URL: http://www.joeyvandijk.nl
Is anyone having trouble with the results portion of the app not displaying the regex result?
Posted by: lgordon at May 28, 2009 01:09 PMURL:
I'm having problems too with the last update.
It used to display multiple matches before but it doesn't work now .... not even with things like [0-9]*.
Is it possible to get the previous version?
Posted by: Juan Hernandez at May 29, 2009 08:27 AMURL:
Igordon & Juan,
If you're able to reproduce these issues, please let me know and we'll try to fix them. I can't reproduce them here. Starting up RegExr online or desktop, and typing in [0-9] shows 3 results on the default text (0,3,3).
Posted by: Grant Skinner at May 29, 2009 02:23 PMURL: http://gskinner.com/blog/
Hi Grant,
I'm not sure but I think the matches used to work slightly different (I don't have the previous version so I cannot confirm it 100%).
When putting an expression with the default text like (\w*) (to match all the words) only the first word is matched. I think like it was before it would have matched every word in the text.
Posted by: Juan Hernandez at June 2, 2009 10:19 AMURL:
Juan,
You'll notice that \w* turns red, this is because it can match 0 characters, and get stuck in an infinite loop. If you change your search to \w+, which requires at least one character to match, you should see the result you are expecting.
Posted by: Grant Skinner at June 2, 2009 10:29 AMURL: http://gskinner.com/blog/
This is an awesome tool. Two things that may make a small improvement: the ability to be able to zoom in (make the text bigger), and the ability for sharing (in other words, having a URL that will auto-init the page with the data that I would like to share). Also, a dropdown to select the language in which the RegEx will be used (since not all languages support all of the RegEx capabilities).
Other than that, this is my tool of choice now.
Posted by: Dmitriy at June 2, 2009 01:44 PMURL:
On what software was the UI made?
Posted by: xzeth at June 7, 2009 11:47 PMURL:
Exactly what I needed. Thanks!
Posted by: Joe Kotvas at July 1, 2009 09:56 PMURL:
Really lovely thing. But I wanted a desktop version I failed to install on Intrepid Ibex and Jaunty Jackalope latest updated version of Ubuntu Linux. the RegExr.Air file doesn't download at all. Even if it downloads then Adobe AIR installer says its corrupted.
Posted by: Lenin at July 3, 2009 11:04 AMURL: http://twitter.com/nine_L