Closed Bug 664527 Opened 9 years ago Closed 9 years ago

"Error: regular expression too complex"

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 625600

People

(Reporter: jacob, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

When I run certain regular expressions (see below) on a long subject string, Firefox shows the error "regular expression too complex". This happens on the Windows and Mac versions of FF4. It doesn't happen in FF3, IE, or Chrome.

The sample regex is from the ExtJS library, and several users have encountered the same issue:
https://support.mozilla.com/en-US/questions/797123
http://www.sencha.com/forum/showthread.php?129952

There are a few other bugs open for the same error, but with seemingly different causes. For example, #652909, #592569, and #654693. Please let me know if this is a duplicate.

Reproducible: Always

Steps to Reproduce:
Run the following script. It generates a long string, then runs a regular expression on it.

var html = '<script>' + new Array(142857).join("x");
html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");

If you change 142857 to 142856, it works without an error.

Actual Results:  
"Error: regular expression too complex" appears in error console.

Expected Results:  
No error.
Yarr strikes again?
Whiteboard: DUPEME
Yeah, this should be fixed with YARR update in bug 625600 that removes the evil PCRE part of the engine. I think this is WONTFIX (for FF4) so long as we confirm that it works on trunk.
Considering comment2, can you please change the status of this bug when you have more info about this.
thx.
BTW, this is still broken in FF5.
This problem is fixed in Firefox Nightly 64bit,  probably in the 32bit version too.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 625600
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.