Regular Expression
Source Text
Import Url
Import File


is a regular expression editor that allows you to comprehensively evaluate any regular expression pattern using a variety of convienent tools. To do this, all you need to do is enter a regular expression and some text to test against, and immediately (okay a second later) you'll be able to visualize successful matches within your text, see the results of splitting the text into an array, replace matched text with a string or function, and much, much, more 1.

REY was created by Daniel Gimenez © 2013. It uses your browser's JavaScript RegExp object with extended functionality provided by XRegExp.

If you have a question, found a bug, or have a feature request. Feel free to email me at

See Also:

1. much, much, more coming soon.

Regular Expression Modifiers

The behavior of your regular expression can be modified by changing the engine modifiers above the expression editor. These modifiers are standard to most regular expression engines, but you can use the Current Syntax Tool to view and syntatical differences from the flavor of regular expressions you're used to as well as the differences created when a modifier is added or removed.

Global (g)

When checked, all matches are found. Otherwise only the first match will be shown.

Case Insensitve (i)

Performs a case insensitve search, so that a simple expression such a FIND ME would match characters in a string such as find me, Find Me, and fInD mE.

Multiline (m)

When checked, ^ and $ match line starts and line ends respectively, instead of just the start and end of the entire string.

. all (s)

When checked, the . class will match any character, otherwise it will not match new lines.

Extended (x)

Allows for freespacing (whitespaces are ignored) and line comments.

Explicit Capture (n)

Only named capture groups are captured when this is enabled.

See Also:

Saving your Work

Clicking the Save button over the Regular Expression will bring down a menu that will allow you to a save a new copy of your current session or update the existing session.

When you save a new session, a permalink will be returned that you can use to access your work later. If you make changes, but don't want to save a new item, you can click Update.

For now, you will only be able to update a link on the computer you initialy created it on.


Currently there are five tools available on the right panel of the application, but there is certainly room for more.

Current Syntax

Displays the entities available for a regular expression, given the currently selected modifiers. Entities the may not be available with other options are highlighted in yellow.

Find and Replace

Displays the results of replacing matched text with either plain text (that can include references to groups $1 to $9), or the results of a javascript function. Use the following template to help get you started using a function to replace text.

function viewCaptures () { var result = ''; for (var i = 0, il = arguments.length - 2; i < il; i++) { result += i.toString() + ': ' + arguments[i] + '\n'; } return result; }


Displays up to 50 of your last edits to your regular expression.

Match Visualizer

Shows where matches occur in a document and breaks the matches down into their respective groups.

String Split

Breaks the text up into an array, using the matched text as a delimiter. In JavaScript any text matched in a group is included in the array.


Runs a performance test of your regular expression against the current text.

Performance Tool

The Performance Tool runs a test of your regular expression's performance against your current target text.

Each time you run a test, the result is added to a list of results so that you can evaluate how your changes effect performance. The higer the number, the better the performance of the regular expression.

Querystring Parameters

You can put querystring parameters into the url. This is somewhat redundant with regards to saving, but will be 100% permanent whereas saving has a time limitation.

reThe Regular Expression to edit.
txtThe text to test the expression on.
urlA url to load the text to test the expression on.
toolThe default tool to load. The possible values are currently: reyCurrentSyntax, findAndReplace, mapVisualizer, reyStringSplit. This will change in the future to something shorter.
optionsA string with the regular expression modifiers. For example gi would result in the options global and case insensitve being used.
prm.**** This is an optional tool parameter. Only applies to current tool. Currently only supported by Find and Replace.
  • prm.function: replace function
  • prm.text: replace text
  • prm.mode: function or text

REY Road Map

What's coming up:


I'm going to get around to adding oauth athentication so that I can expand the saving functionality, and then add some community features.

Saving Sessions

Saving Sessions is well on its way. I've moved over to a hosted mongodb instance on

Eventually want to add the ability to save history and allow for versions like jsFiddle.

More Regex engines

This is far into the future, but I want to add server side regular expression functionality. I really only have to override one module to make this possible in its most basic form, but then things like syntax and group parsing have to be updated for each supported engine as well.

Tool Updates

  • Match Visualizer: Highlight the group in the regex text when hovering over a match.
  • Match Visualizer: Hide line numbers on formatted text tab.

New Tools

  • Regular Expression Visualizer: There are some awesome tools that diagram regular expressions. I want to do something better.
  • Unicode Escaper: Converts Unicode text to regex escape charaters.


  • Clean up code -- I'm slowly sinking into speghetti world...


It fills me with awe whenever I realize that any program I create is built upon a foundation of a seemingly infinite array of projects, applications, and frameworks. REY would not have been possible without, and in the very least, the following projects/sites/applications.

Open Source Projects


XRegExp extends JavaScript's native RegExp object to add a lot of useful features and fix some cross-browser issues. You can safely use it in place of RegExp without an icompatibility issues.

Ace Code editor

The Ace Code Editor is the editor used throughout all the application. Definitely the best browser based code editor.

jQuery and jQuery UI

JavaScript would be such a pain without jQuery.


I started using Mongodb for the file saving. I love how easy it is to use.


One day we will live in a word without cross-browser compatibility issues. Until that day there is Modernizr.

Reference Sites

I've been using this website forever. Everything you need to know about Regular Expressions you can find here.

Stack Overflow

I've recently become addicted to this site, and it is my go to for answers.

Mozilla Developer Network

... and this comes up second or third. Plus it was a little more clear about Regular Expressions in JavaScript.


I didn't know LocalStorage existed, or that you could upload files without a server. Thanks HTML5 ROCKS!

Other Regular Expression Editors

Imitation is the sincereness form of flattery. I hope the makers of these programs agree.

gskinner's RegExr

Probably the best online regular expression editing tool. Made in Flash.

... that other one...

There was another one where I got the idea to upload files and import urls from. I apologize to the author for forgetting.

Hosting providers

Mongo Lab

Mongolab provides free mongodb hosting.