Ondra Žižka
Ondra Žižka

Reputation: 46796

Java regex library with recursion support

I am looking for a Java regexp lib with support for recursion, like:

"<a+(?0)>"

JDK does not support it, ORO does neither.

Anyone knows about such?

Thanks, Ondra

Edit: See http://www.php.net/manual/en/regexp.reference.recursive.php

And I need it for this expression:

(?:mUi)^/--++ *+(.*)(?: *(?<= |^)\\.((?:\\([^)\\n]+\\)|\\[[^\\]\\n]+\\]|\\{[^}\\n]+\\}|<>|>|=|<){1,4}?))?$((?:\\n.*+)*)(?:\\n(?0)|\\n\\\\--.*$|\\z)

Upvotes: 1

Views: 2166

Answers (2)

Ondra Žižka
Ondra Žižka

Reputation: 46796

The answer is: There's none. I could possibly modify the JDK's java.util.regex.

Upvotes: 0

Alan Moore
Alan Moore

Reputation: 75222

The Stevesoft Pat library has some recursive-matching capability (documented here), but that feature probably isn't as useful as you expect it to be. If recursive matching is that important to you, you should probably be using a real parser instead of regexes.

Upvotes: 2

Related Questions