The aim of the repan project is to perform various tasks on regular expressions except pattern matching. Repan can parse various regular expression flavors, can analyze or optimize them, and can construct new pcre patterns which match to the same strings as the original patterns.
To build the project, simply run:
make
Debugging can be enabled using CFLAGS
CFLAGS="-DDEBUG_REPAN"
The location of the repan library is out/librepan.a
Include include/repan.h in your project, and link it wtih out/librepan.a. The patterns can be parsed by the repan_parse... functions, and a new pattern can be generated by repan_to_string_... functions. The patterns can be modified by repan_opt_... functions.
Further pattern modifications can be added to the project, and it is encouraged to do so. The patterns are compiled to a tree which nodes can be manipulated by varios helper functions.
Tests can be run by tests/run_test.py script. Verbose can be enabled by -v. All test files and their expected output are simple .txt files, so a text viewer can be used to check the effect of various pattern modifications.