Skip to content

zherczeg/repan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REPAN (Regular Expression Pattern Analyzer)

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.

Building

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

Using the library

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.

Testing

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.

About

Regular Expression Pattern Analyzer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages