Hi all, 

I've a big problem matching really long Strings with jakarta-oro
2.0.1.
I'd searched the FAQ distributed by jakarta.apache.org and found 
nothing matching my problem. 
This is really my last chance, because i'd upgraded from oro-1.1 to
oro-2.0.1, but the bug is the same. 
No the problem in detail:

I use this expression

/(.*)##(([^#\\|]|#[^#\\|])+)(\\|((\\w+://)?([^#]|#[^#])+))?##(.*)/"

...to match a text like:

"Im a text an i want to be ##linked##" URL="http://blabla"

The result of the match is parsed by groups in another routine. At 
the text between ##, a URL should be inserted. On short texts, to a
length of 290 to 293 the Matcher works fine, but on a String, longer 
than 290 chars the Matcher bounces between line 1043 and 1013 in 
Perl5Matcher.__match

java.lang.StackOverflowError
    at org.apache.oro.text.regex.OpCode._getNext(OpCode.java:169)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:725)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)

.... thousands of lines, bouncing between line 1043 and 1015.....

    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1015)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1043)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:983)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:958)
    at
org.apache.oro.text.regex.Perl5Matcher.__match(Perl5Matcher.java:1131)
    at
org.apache.oro.text.regex.Perl5Matcher.__tryExpression(Perl5Matcher.java:618)
    at
org.apache.oro.text.regex.Perl5Matcher.__interpret(Perl5Matcher.java:336)
    at
org.apache.oro.text.regex.Perl5Matcher.contains(Perl5Matcher.java:1620)
    at org.apache.oro.text.perl.Perl5Util.match(Perl5Util.java:353)
    at org.apache.oro.text.perl.Perl5Util.match(Perl5Util.java:400)


I'd tested the code under JRun 2.3.3 and Tomcat 3.2.1. The error 
occurs on both engines. I hope you could help me to solve the 
problem. Probably the expression is "to hard" for ORO?
I'd probed it with gnu-regexp and it's working fine with long strings,
but i'd to take ORO.

In hope for a quick answer,

Michael Große,
from Germany

Reply via email to