Closed
Bug 476146
Opened 16 years ago
Closed 11 years ago
Missing capture in Spidermonkey regexp engine
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: erik, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.18) Gecko/20081117 Firefox/2.0.0.18
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.18) Gecko/20081117 Firefox/2.0.0.18
The above regexp doesn't capture the first b.
Reproducible: Always
Steps to Reproduce:
1. javascript:alert(/^(b+|a){1,2}?bc/.exec("bbc"))
2.
3.
Actual Results:
bbc,
Expected Results:
bbc,b
From the PCRE test suite. Works fine in other browsers.
Comment 1•16 years ago
|
||
Firefox 2 has reached its EOL and is no longer supported, please upgrade to the current 3.0 Branch.
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
Works fine for me.
Updated•16 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Reporter | ||
Comment 2•16 years ago
|
||
I can reproduce this in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2 so I don't think it's a FF2 issue.
Reporter | ||
Comment 3•16 years ago
|
||
If I add a ? after the + to make the regexp non-greedy then it works correctly.
A probably related issue, also from the PCRE test suite:
javascript:alert(/((\3|b)\2(a)){2,}/.exec("bbaababbabaaaaabbaaaabba"))
gives abba,bba,b,a
Should give bbaa,a,,a
Again, with the abba example it works correctly if I add a ? after the } to make it non-greedy.
Updated•16 years ago
|
OS: Linux → All
Hardware: x86 → All
Comment 4•16 years ago
|
||
dupe of bug 351344 ?
Reporter | ||
Comment 5•16 years ago
|
||
Most likely, yes.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Updated•16 years ago
|
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Reporter | ||
Comment 6•16 years ago
|
||
Thanks for unduping, since the dupe was erroneously marked invalid.
Comment 7•11 years ago
|
||
Works at least since FF 24: I just tested in the version 24 SpiderMonkey shell.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago → 11 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•