REGRESSION (r243642): Crash in reddit.com page
[WebKit-https.git] / JSTests / stress / regexp-nongreedy-charclass-backtracks.js
1 // The regression test checks that multiple non-greedy character classes backtrack properly.
2
3 let re = /[^\/]+\/xxx\/[^\/]+?\/[^\/]+?\/[^\/]+?/;
4 let str;
5 let match;
6
7 str = "blah/xxx/blah/blah_blah_blah_blah_blah_blah_blah_blah_blah_blah/";
8 match = re.exec(str);
9 if (match !== null)
10     throw(re + ".exec(\"" + str + "\") Should not have matched!");
11
12 str = "blah/xxx/blah/blah_blah_blah_blah/";
13 match = re.exec(str);
14 if (match !== null)
15     throw(re + ".exec(\"" + str + "\") Should not have matched!");