Regular Expression Calculator
XML Menu Suite
Build powerful, client-side DHTML menus using XML for data and CSS for style. No JavaScript data! No having to place list elements on every single page of your website! No plug-ins!

Regular Expression Calculator is an online tool that allows you to easily test and generate JavaScript code for Regular Expressions.

Usage Instructions are below.

Regular Expression Calculator

help Flags

help Operation

help Regular Expression: ( Example: \w )

help Source Text:

help help

help Result:

help Literal Value:

Usage Info for Regular Expression Calculator

Flags:

Regular expression pattern matching rules. Possible values are:

  • global: Performs global match
  • insensitive: Case insensitive match
  • multiline: Multiline mode

Operation:

Indicates which regular expression method will be executed when the "Evaluate" button is clicked. Possible values are:

  • test: Calls the test() method of the regular expression created from the text entered in the Regular Expression field. The source string is created from the text entered into the Source Text field.
  • match: Calls the match() method on the string created from the text entered into the Source Text field, using the regular expression created from the Regular Expression field as the criteria for the match.
  • search: Calls the search() method on the string created from the text entered into the Source Text field, using the regular expression created from the Regular Expression field as the criteria for the match.
  • replace: Calls the replace() method on the string created from the text entered into the Source Text field, using the regular expression entered into the Regular Expression field as the criteria for the match. The replacement string used is created from the text entered into the Replacement Text field.

Regular Expression:

The text entered in this field is converted into a regular expression literal.

Note: Do not enter a regular expression literal. In other words, do not insert your regular expression inside of slash (/ /) characters.

Source Text:
The text entered in this field is converted into a string.

Replacement Text:
This field is only visible when the replace option is selected as the Operation. The text entered into this field is converted into a string.

Evaluate:
Pressing the "Evaluate" button will cause the regular expression entered in the Regular Expression field to execute, using the operation specified in the Operation field. The result of the regular expression evaluation is sent to to the Result field.

Auto Clear:
Checking this option will automatically clear the Result field every time a regular expression evaluation is performed.

Result:
Displays the output of regular expression evaluations. A regular expression evaluation can be performed by pressing the "Evaluate" button.

Literal Value:
This is the regular expression literal value used for evaluation. It is formed from the text of the Regular Expression field, and the options specified in the Flags fields.