Javascript Regular Expression Tester

This page is an online tester with full syntactical support for JavaScript (JS) Regular Expressions (REs) and Replacement Expressions.  It can be used to test REs too difficult, inconvenient, or inefficient to test within code under development.

All of the RE and String methods/functions which use REs can be tested  the input for specifying a replacement expression is only displayed when the appropriate method is selected.

You can specify the RE with or without bounding slashes (/), but when they're included, the checkboxes defining switches are ignored; any required switches must be included in the RE text.

Copy Output To Input can be used when testing a conversion process with several steps.

Notes:

  1. You will need to double up backslashes (\) when pasting as string literals REs tested here into JS source code;
  2. JS handling of REs varies from interpreter to interpreter, and therefore browser to browser  for example:

 

 

           

 

 

 

 

 

 

Updated Description
13/06/2010 v1.1  -  Safer Array for() loops if the Array.prototype is altered.
09/12/2009 Created v1.