Skip to content
An ANTLR 4 grammar for PCRE
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main
.gitignore Initial commit. Mar 21, 2014
LICENSE
README.md
pom.xml Initial commit. Mar 21, 2014

README.md

PCRE parser

An ANTLR 4 grammar and parser for PCRE (Perl Compatible Regular Expressions).

To generate the parser classes, do a mvn clean install and then do something like this:

import nl.bigo.pcreparser.*;

// ...

String regex = "((.)\\1+ (?<YEAR>(?:19|20)\\d{2})) [^]-x]";

PCRELexer lexer = new PCRELexer(new ANTLRInputStream(regex));
PCREParser parser = new PCREParser(new CommonTokenStream(lexer));
ParseTree tree = parser.parse();

// ...

To print an ASCII tree of the generated parse tree, see the Main class.

You can’t perform that action at this time.