Regular Expression Test Applet
Fall 2002, David Matuszek Summer 2006, Guy Lapalme |
The point of this applet is to provide a convenient means of testing regular expressions before embedding them in a Java program. The buttons represent calls to the Java methods with the same name.
The applet executes (approximately) the following code:
pattern = Pattern.compile(Contents of the Pattern: field); matcher = pattern.matcher(Contents of the String: field); matcher.Whatever_method_you_clicked(); Display results;
In Java:
field shows how you would have to write the regular
expression as a Java literal string. You can type or paste from and to a Java program
into this area. It is kept in sync with the pattern
string.
start()
, end()
, and
group(n)
.
java -cp RegexTester.jar RegexTester