Java Regular expressions on steroids. Allows named groups, sub expressions and expression functions.
Failed to load latest commit information.
src a ton of fixes and updates to matching Jul 14, 2012
.gitignore initial commit Jun 9, 2012
LICENSE added license Jun 9, 2012
README.markdown Update master Jun 9, 2012


This library wraps JAVA Pattern's in an Expression class that is able to use sub expressions, function expressions and named groups.

It handles infinite nesting of everything.


${subExpressionId}         - Allows the reuse of common expressions like numbers, dates etc. These sub expressions must 
                             first be registered within an expression context

${functionId(args...)}     - Allows the use of special ExpressionFunction instances that can be used to generate large 
                             sets of data or complex patterns. Functions need also be registered within an expression

(capital_letters:[A-Z])    - Named groups within your regular expressions.


//Initialize an expression context.
ExpressionContext ctxt = new ExpressionContext(); 

//Add Range() ExpressionFunction with an id of "range". Function takes 2-3 arguments: (int from,int to,int width)
ctxt.add("range",new ExpressionFunction.Range()); 

//Add sub expression with id "letters"

//Add sub expression with id "numbers"

//Compile the expression you need
Expression expr = ctxt.compile("${letters}_(num:${numbers})_${range(9,12,2)}");

//Create matcher for text
ExpressionMatcher matcher = expr.matcher("Does it match ABC_123_09 and XYZ_321_10 ?");

//Start matching
while(matcher.find()) {
    //Get contents of named group
    String number ="num"); //123 and 321

    //Get entire match
    String match =; //ABC_123_09 and XYZ_321_10