Closed
Bug 254296
Opened 21 years ago
Closed 21 years ago
javascript regular expression negative lookahead
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.8alpha3
People
(Reporter: kal_el_1938, Assigned: brendan)
Details
(Keywords: fixed-aviary1.0, fixed1.7.5, js1.5, Whiteboard: needed-aviary1.0)
Attachments
(2 files)
2.06 KB,
patch
|
shaver
:
review+
bugs
:
approval-aviary+
dveditz
:
approval1.7.5+
|
Details | Diff | Splinter Review |
2.21 KB,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Using client-side javascript regular expression a negative lookahead (?!) the
look-ahead fails before the entire group is evaluated. Seem to short-curciut
For example ^\d(?!\.\d) ,a digit not followed by a decimal and a digit,fails to
match 3.A because it the digit is followed by a decimal. Doesn't check to see
if the decimal was followed by a digit. The same expression tested using IE and
Opera matched 3.A
Used the webpage http://www.unusualresearch.com/regex/toolrei.htm to test with.
Reproducible: Always
Steps to Reproduce:
1.Used the webpage http://www.unusualresearch.com/regex/toolrei.htm or
http://www.regexlib.com/RETester.aspx with javascript option using Mozilla or
Firefox
2. use regular expression ^\d(?!\.\d)
3.Test with string 3.A
Actual Results:
No match was found
Expected Results:
Found 1 match
Assignee | ||
Comment 1•21 years ago
|
||
Sweet, sweet regexp, as shaver would say. Rogerl's big rewrite regained the
long-lost Netscape 4.x-era bytecoded NFA performance, but here's yet another bug
as fallout, or payback.
/be
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.7.3+
Flags: blocking-aviary1.0+
Keywords: js1.5
Target Milestone: --- → mozilla1.8alpha3
Assignee | ||
Comment 2•21 years ago
|
||
Both REOP_ASSERT and REOP_ASSERT_NOT assumed that a leading "simple" reop was
all there was in the assertion, failing to see whether SimpleMatch advanced pc
to the next pc after the assertion.
Assignee | ||
Updated•21 years ago
|
Attachment #155753 -
Flags: review?(shaver)
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Comment 3•21 years ago
|
||
Comment on attachment 155753 [details] [diff] [review]
proposed fix
I wonder how many more licks we need to get to the centre. r=shaver.
Attachment #155753 -
Flags: review+
Assignee | ||
Comment 4•21 years ago
|
||
Comment on attachment 155753 [details] [diff] [review]
proposed fix
Should get into all active branches ASAP.
/be
Attachment #155753 -
Flags: review?(shaver)
Attachment #155753 -
Flags: approval1.7.3?
Attachment #155753 -
Flags: approval-aviary?
Assignee | ||
Comment 5•21 years ago
|
||
Fixed on the trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Whiteboard: needed-aviary1.0
Comment 6•21 years ago
|
||
Comment on attachment 155753 [details] [diff] [review]
proposed fix
a=dveditz for 1.7.3
Attachment #155753 -
Flags: approval1.7.3? → approval1.7.3+
Comment 7•21 years ago
|
||
Attachment #155753 -
Flags: approval-aviary? → approval-aviary+
Assignee | ||
Comment 8•21 years ago
|
||
Fixed on MOZILLA_1_7_BRANCH and AVIARY_1_0_20040515_BRANCH.
/be
Keywords: fixed-aviary1.0,
fixed1.7
Updated•21 years ago
|
Keywords: fixed1.7 → fixed1.7.x
Comment 9•20 years ago
|
||
Michael, with your permission this will be included in the javascript test
library.
Reporter | ||
Comment 10•20 years ago
|
||
(In reply to comment #9)
> Created an attachment (id=174927) [edit]
> js1_5/Regress/regress-254296.js
>
> Michael, with your permission this will be included in the javascript test
> library.
Sure. Glad I could help
Comment 11•20 years ago
|
||
js/testsjs1_5/Regress/regress-254296.js checked in. Thanks Michael!
Updated•20 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•