This page provides a convenient means of testing regular expressions before embedding them in a Javascript program. The buttons at the bottom of this page represent calls to the Javascript methods of the same name [More information about the regular expression syntax]
exec
button, the page executes (approximately) the following code:
var pattern = /Contents of the Pattern: field/g;
matches = pattern.exec(Contents of the String: field);
display the indexed elements of matches
array
re-exec
continues matching on the same string after last match.test
and re-test
buttons do the same processing but with the test
method that only checks if the pattern matches the string somewhere without giving any other information.datalist
element)String: | |
Pattern: | |
Flags: |
This page is patterned after Java applet with a similar facility