Perl Regular Expression Simulator

This should allow you to try out a perl regular expression. You could write a simple perl program to do exactly the same thing, but this allows you to change things slightly to see how the results are affected. Give it a try!

  1. Fill in the fields:
  2. Click on the ``Try Regular Expression Button'' at the bottom of the Java applet.

After a (hopefully short) time, you should see the results of the match.

Just in case you don't know, here is a table describing what the different variables mean:

$&The text that that matched.
$`The text that occurred before the text that matched.
$'The text that occurred after the text that matched.
$nThe text that matched within the nth set of parens. (Count the open parens from left to right to figure out which is the nth set.)

If you can read this, you are using a browser that is not capable of running Java applications. If you were running, say a later version of Netscape Navigator or Microsoft's Internet Explorer 3.0, you would be seeing a live demonstration tool for writting regular expressions.