Bug 27763 - Incorrect reluctant matching when they contain another quantifiers
Summary: Incorrect reluctant matching when they contain another quantifiers
Alias: None
Product: Regexp
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Jakarta Notifications Mailing List
Depends on:
Reported: 2004-03-18 04:49 UTC by Oleg Sukhodolsky
Modified: 2007-03-23 13:46 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Sukhodolsky 2004-03-18 04:49:17 UTC
I've tried to match 1__ line against ^(1_*)??_$, ^(1_*)*?_$, and ^(1_*)+?_$
In all cases I get negative answer.
But ^(|1_*)_$ (which is the same as last one) matches the string.

As far as I understand the cause of this problem is that we use OP_RELUCTANTXXX
for these quantifiers and process them incorrectly.
Perhaps we should do the same as for greedy quantifiers, i.e. replace X?? by
(|X), X+? - XX*?, and X*? by (|X{gotoX})
Comment 1 Vadim Gritsenko 2007-03-10 20:29:51 UTC
I think I have another approach - fix processing of OP_RELUCTANTXXX, and
implement OP_PLUS etc similarly to cut down on program length and complexity.

Would you have more testcases? Specifically I'd like to have more complicated
testcasees where plus/star/maybe are used several times and grouped/nested into
each other. Thanks.
Comment 2 Vadim Gritsenko 2007-03-12 19:57:06 UTC
implemented fix for reluctant closures