support inverted char class and dot

This commit is contained in:
Erik Krogh Kristensen
2020-10-31 18:11:14 +01:00
parent 64d680e2d3
commit 804aaf36f0
3 changed files with 7 additions and 4 deletions

View File

@@ -454,12 +454,11 @@ string intersect(InputSymbol c, InputSymbol d) {
) )
or or
exists(RegExpCharacterClass cc | c = InvertedCharClass(cc) and result = chooseFromInverted(cc) | exists(RegExpCharacterClass cc | c = InvertedCharClass(cc) and result = chooseFromInverted(cc) |
// TODO: Not done here - later commits will add more
//d = Dot() and
//not (result = "\n" or result = "\r")
//or
d = InvertedCharClass(cc) d = InvertedCharClass(cc)
or or
d = Dot() and
not (result = "\n" or result = "\r")
or
d = Any() d = Any()
) )
or or

View File

@@ -55,3 +55,4 @@
| tst.js:89:25:89:32 | (a\|aa?)* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. | | tst.js:89:25:89:32 | (a\|aa?)* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
| tst.js:95:15:95:25 | ([^]\|[^a])* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'b'. | | tst.js:95:15:95:25 | ([^]\|[^a])* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'b'. |
| tst.js:98:15:98:20 | [^"']+ | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '('. | | tst.js:98:15:98:20 | [^"']+ | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '('. |
| tst.js:101:15:101:23 | (.\|[^a])* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'b'. |

View File

@@ -96,3 +96,6 @@ var bad18 = /(([^]|[^a])*)"/;
// NOT GOOD // NOT GOOD
var bad19 = /([^"']+)*/g; var bad19 = /([^"']+)*/g;
// NOT GOOD
var bad20 = /((.|[^a])*)"/;