Author: Oleg Sychev Date: To: pcre-dev Subject: [pcre-dev] trying to write PCRE-compatible regular expression
parser: conditional subpatterns problem
Hello, anyone.
I'm trying to develop a PCRE-compatible regular expression parser. I have
run into trouble considering conditional subpatterns:
(?(assert)yes-expr|no-expr)
There is conflict between | as a alternative operator in expression and | as
a delimeter between yes and no expressions. The docs says it gives parse
error if there is more than two alternatives in expression. However, nothing
is said about is using alternative in subpattern inside expression valid or
not, i.e. is this expression valid
(?(?=a)(b|c)|d)
I found no docs at all on this. Please clarify you syntax.
Best regards, Oleg Sychev, Senior Lecturer of Software Engineering
Department of Volgograd State Technical University.