Regular Expression Library for Java
This folder contains regular expression library for java. There are two
major implementations: one involves compiling regular expression into java
class; the other one compiles it into some intermediate form that is then
interpreted. Compilation into class is more efficient, but it needs class
loader to work properly, so it cannot be used in applets unless all
regexes are pre-compiled.
Here
is the list of supported constructions.
See the source code for class kmy.regex.util.Grep
for sample code that uses the library.
Testing
Some basic functional and perfomance testing can be done using retest script.
It takes input from the file regex.txt that contains regular expressions,
test strings and expected results. retest -c runs test for compiled-to-class
regex implementation. Options -v or -cv can be used for verbose output.
Options -p or -cp can be used for perfomance test. retest.perl script runs
similar tests for perl for comparison.