add two test cases that demonstrate the limits of the suffix construction

This commit is contained in:
Erik Krogh Kristensen
2020-11-26 10:04:53 +01:00
parent f576144ec6
commit e177d46c0a
2 changed files with 8 additions and 0 deletions

View File

@@ -121,3 +121,5 @@
| tst.js:299:90:299:91 | e+ | This part of the regular expression may cause exponential backtracking on strings starting with '00000000000000' and containing many repetitions of 'e'. |
| tst.js:302:18:302:19 | c+ | This part of the regular expression may cause exponential backtracking on strings starting with 'ab' and containing many repetitions of 'c'. |
| tst.js:305:18:305:20 | \\s+ | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of ' '. |
| tst.js:308:16:308:24 | ([^/]\|X)+ | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'X'. |
| tst.js:311:20:311:24 | [^Y]+ | This part of the regular expression may cause exponential backtracking on strings starting with 'x' and containing many repetitions of 'Xx'. |

View File

@@ -303,3 +303,9 @@ var bad66 = /^ab(c+)+$/;
// NOT GOOD
var bad67 = /(\d(\s+)*){20}/;
// GOOD - but we spuriously conclude that a rejecting suffix exists.
var good36 = /(([^/]|X)+)(\/[^]*)*$/;
// GOOD - but we spuriously conclude that a rejecting suffix exists.
var good37 = /^((x([^Y]+)?)*(Y|$))/;