Mike's JavaScript and AJAX

Enter and evaluate Regular Expressions

Enter a Regular Expression to run against the data in the next row.

Turn on multiline flag

For the rules on regular expressions see the notes at the bottom of this page.

Enter the data to run the regular expression in the first row against
Click this to run evaluate the regular expression in the first box against the data in the second box.
Your regular expression is:
Command Executed

These are all the strings from the data in the 2nd box that match the regular expression in the first box.
Variables set in RegExp.xxxx

  1. Regular expressions normally begin and end with a / like
    /regular expression/
  2. Regular expressions can end with a modifier such as i, g or m like
    /regular expression/igm
  3. This program does not validate the regular expression you enter.
  4. For more information on regular expressions check out 1 2


1) I didn't add the logic to this program to handle data that contains < and > and & data. Sometimes the code will work, sometimes it won't. I just created this program as toy to play with regular expession in JavaScript.

2) I don't validate any of the regular expression entered. If you enter an invalid regular expression the code usually just displays the results from the last valid regular expression


Results 2