Closed Bug 901910 Opened 11 years ago Closed 9 years ago

Incorrect regex matching of a dot with a quantifier with a lower bound of 0

Categories

(Core :: JavaScript Engine, defect)

22 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mhaymo, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release)
Build ID: 20130618035212

Steps to reproduce:

http://regexpal.com/?flags=gm&regex=^.{0%2C2}[%2F\\]bar[%2F\\].*%24&input=C%3A\opt\foo\bar\lol%0Alol%0A%2Fbar%2Flol%0AC%3A\bar\lol%0Abar%0A%2Fbar%0A%2Fbar%2F%0A


Actual results:

Lines 1, 3, 4 and 7 are matched


Expected results:

The first line should not be matched, and isn't on Chrome or Internet Explorer. The same thing is happening when you replace `.{0,2}` with `.?`, so the bug seems to depend on a quantifier with a lower bound of zero. And it only seems to happen with the dot.
Assignee: nobody → general
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build ID: 20130812030209

I can confirm this issue on the latest Nightly (the issue is not reproducible on Firefox 4.0).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: general → nobody
No longer reproducible, /^.{0,2}[/\\]bar[/\\].*$/.exec("C:opt\foo\barlol") returns null. Resolving as WFM.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.