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)
Tracking
()
RESOLVED
FIXED
People
(Reporter: alexander.grimalovsky, Assigned: rogerl)
References
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
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.
Reporter | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
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 - (?)
Assignee | ||
Comment 3•22 years ago
|
||
I have updated the patch for bug 85721 to fix these cases.
Depends on: RegExpPerf
Comment 4•22 years ago
|
||
Reporter | ||
Comment 5•22 years ago
|
||
Thank you all for your work and incredible product!
Comment 6•21 years ago
|
||
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.
Description
•