|
From: SourceForge.net <no...@so...> - 2009-05-30 21:15:50
|
Bugs item #2798939, was opened at 2009-05-30 22:15 Message generated for change (Tracker Item Submitted) made by bilgexa You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2798939&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 43. Regexp Group: current: 8.5.7 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bilge (bilgexa) Assigned to: Pavel Goran (pvgoran) Summary: Non-greedy quantifiers revert to greedy when branched Initial Comment: Non-greedy quantifiers revert to greedy when used in conjunction with branches (pipe character). The following branch-free expression matches each letter in the test string and therefore correctly returns 14 regexp -all .+? {this is a test} The following branched expression matches the entire string only once because the quantifier reverts to greedy and therefore incorrectly returns 1 regexp -all .+?|x {this is a test} This breaks a lot of complex regular expressions that require non-greedy quantifiers and branches. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2798939&group_id=10894 |