What’s the maximum size of a regular expression in modern browsers (i.e. Firefox 3+, Safari 4+, IE 7+)? Assume a simple regular expression, of, say “foo|bar|baz|woot|…”
What’s the maximum size of a regular expression in modern browsers (i.e. Firefox 3+,
Share
You can use this code to test, in IE8 / firefox with firebug / Chrome.
When you get a error, you found the limit.
SIMPLE TEST
RESULTS
In Firefox 3.6.3 (Ubuntu 32 bits) I get error when I tried a regex with
9M chars (9.999.990 chars)3.204.161 chars. With 3.204.160 it’s ok.In Chrome 5.0.3 the limit is something between 20M and 25M chars.
The error, in firefox, is:
Note: If you did some test, please comment here.