Closed Bug 1648896 Opened 4 years ago Closed 4 years ago

string.match causes engine to hang with specific string and RegEx expression

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1391654

People

(Reporter: official.xenrix, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0

Steps to reproduce:

I ran this in the Firefox browser dev console, but it should apply anywhere.

Create a new variable with the contents of this Pastebin -> https://pastebin.com/raw/5RzydPW8

Run the following (replacing myString with your variable name): console.log(myString.match(/\]\(*(.*?)*\)/))

Actual results:

Firefox notified of a webpage slowing down the browser about 10s after executing this code.

Expected results:

The browser console should have returned an array of matched items, as shown on the Regexr website for the exact same string and RegEx expression

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

Note: /\]\((.*?)\)/ should accomplish what it looks like you're trying to do without exponential blowup.

You need to log in before you can comment on or make changes to this bug.