Closed Bug 191479 Opened 22 years ago Closed 21 years ago

regular expressions like /(x|y){n,}/ are failed in some cases

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: alexander.grimalovsky, Assigned: rogerl)

References

Details

Attachments

(1 file)

Mozilla trunk build ID: 2002122708 on Windows 2000 Take a look at following example: Regular expression: /(\d|\d\-|\d\s){2,}/ Matched string: 12 3 45 This expression matches given string. But after small improvement: /(\d|\d\-|\d\s){4,}/ It isn't match it anymore, while it should (and it works in IE5.01 for example). It also starts to match this string again if {4,} quantifier is replaced with '+' quantifier or if search condition is rewritten as (\d\s?). I've prepare testcase to demonstrate a problem.
Testcase added to JS testsuite: mozilla/js/tests/ecma_3/RegExp/regress-191479.js This contains Alexander's tests above. In addition, I experimented by reversing the order of the operands, and added cases where the quantifiers are non-greedy (by appending ? to them). All the "expected" outcomes have been verified against the Perl 5 regular expression engine. The testcase is passing in the current Rhino shell, which makes me think this bug is yet another duplicate of the RegExp bug 85721. However the testcase is not passing for me with the latest patch for bug 85721, so perhaps an update is required there - (?)
I have updated the patch for bug 85721 to fix these cases.
Depends on: RegExpPerf
Confirming - with the latest patch for bug 85721, the testcase passes. Alexander: we'll be finished once the patch for bug 85721 is reviewed and checked in. This may take some time, however, as it is a complete rewrite of the regular expression engine -
Thank you all for your work and incredible product!
Fixed with bug 85721. /be
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: