jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23132] - Perl5Util.match() hangs/loops in certain cases
Date Fri, 12 Sep 2003 15:00:58 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23132>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23132

Perl5Util.match() hangs/loops in certain cases

dfs@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Major                       |Enhancement
             Status|NEW                         |RESOLVED
         Resolution|                            |LATER



------- Additional Comments From dfs@apache.org  2003-09-12 15:00 -------
Although this behavior is unfortunate, it is not a bug per se.  Perl regular
expressions are mini-programs of sorts and can easily lead to slow matching
or even infinite loops.  This behavior is common when you nest quantifiers
which produce ambiguous interpretations for an NFA and cause every possible
interpretation of the expression to be attempted. In cases where one of the
quantifiers matches the null (zero-length) string, this can lead to infinite
matching.  Various versions of Perl, including Perl5.003 exhibit this exact
behavior.  We hope to eradicate this behavior as we move to Perl 5.8
compatibility.  However, the problem can always be solved by writing an
equivalent, but more precise regular expression.  For example, if you
change your expression to the equivalent:
   String validationRE = "^(\\w[-\\w_.'&\\/]+)@(\\w+[-_.])+\\w+$";
backtracking is minimized and all matches complete rapidly.

I'm marking this report as LATER and changing the Severity level to
Enhancement so we keep in mind we would like to handle "inefficient"
regular expressions more efficiently.

Mime
View raw message