PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3561 *** shadow/3561 Wed Sep 12 00:38:25 2001 --- shadow/3561.tmp.16941 Wed Sep 12 06:55:04 2001 *************** *** 2,10 **** | Stack overflow with certain patterns. | +----------------------------------------------------------------------------+ | Bug #: 3561 Product: ORO | ! | Status: NEW Version: 2.0.4 | ! | Resolution: Platform: PC | ! | Severity: Major OS/Version: Linux | | Priority: Other Component: Main | +----------------------------------------------------------------------------+ | Assigned To: [EMAIL PROTECTED] | --- 2,10 ---- | Stack overflow with certain patterns. | +----------------------------------------------------------------------------+ | Bug #: 3561 Product: ORO | ! | Status: RESOLVED Version: 2.0.4 | ! | Resolution: LATER Platform: PC | ! | Severity: Normal OS/Version: Linux | | Priority: Other Component: Main | +----------------------------------------------------------------------------+ | Assigned To: [EMAIL PROTECTED] | *************** *** 19,21 **** --- 19,45 ---- ------- Additional Comments From [EMAIL PROTECTED] 2001-09-12 00:38 ------- Created an attachment (id=527) Also works with the pattern inside this .java - file. + + + ------- Additional Comments From [EMAIL PROTECTED] 2001-09-12 06:55 ------- + The problem is really in the pattern, not so much in the matcher. You are + using patterns that match the empty string, which will match an infinite number + of times when used in conjunction with a repetition operator. However, it + is undesirable to repeatedly match the empty string as the result of the + same null matching construct, so we'll try to do + something about this in a later version as we push toward Perl 5.6 + compatibility. The solution for now is to be more careful about writing + patterns (how you write a Perl pattern can have an enormous impact on its + matching efficiency in both Perl and jakarta-oro). If you + really don't want to think about how the NFA represented by a Perl regular + expression is interpreted, then put the empty string matching constructs + as far to the left as possible. In other words, write + "'(\\\\?|[^'\\\\]+)+'" + instead of + "'([^'\\\\]+|\\\\?)+'" + + However, these two patterns do have slightly different meanings and you may + have to reduce the expression to a more efficient equivalent one (see + discussion of "first" and "forward" and NFA reduction in Aho, Sethi, and + Ullman's "Compilers: Principles, Techniques, and Tools" or even "Mastering + Regular Expressions" by Jeff Friedl)
