Question

I am interested in parsing regexes (not to be confused with using regexes for parsing). Is there a BNF for Java 1.6 regexes (or other languages?)

[NOTE: There is a similar older question which did not lead to an answer for Java.]

EDIT To explain why I need to do this. We are implementing a shallow parser for Natural language processing which first identifies and tags tokens. These are then further processed with a regex. I need to know what groups have been captured by the regex (the automaton only captures the last of each bracket) and I also want to annotate the regex with comments.

Was it helpful?

Solution 3

There does not seem to be an explicit regex according to SO replies.

OTHER TIPS

I don't see one specifically for java 1.6; but here's a start that maybe you can build a complete BNF from:

http://www.users.pjwstk.edu.pl/~jms/qnx/help/watcom/wd/regexp.html#RegularExpressionBNF

...using the java 1.6 documentation for Pattern:

http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top