jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: Regex bug report - StackOverflowError
Date Mon, 21 Aug 2000 22:20:10 GMT

>StackOverflowError in RE.matchNodes(int, int, int)
>To reproduce:
>
>RE re = new RE("#[:digit:]*(.|\n)*@");
>re.match(_in_);
>
>Where _in_ is a long String of the following form:

This looks like a report for just the regex-dev group.  Without
having looked at the jakarta-regex source, this bug looks like
a result of recursive implementation of alternation.  It's hard to
get around since every NFA-based regex engine will implement
this recursively.  You should use a character class (e.g., [\0x00-\0xff])
or a modified . (as in compiling with Perl5Compiler.SINGLE_LINE_MASK
in jakarta-oro) rather than (.|\n).  A DFA-based engine like the
org.apache.oro.text.awk package doesn't suffer from this (at least
I don't think so since it merges states), but it only supports 8-bit
characters.

daniel



Mime
View raw message