diff --git a/cpp/ql/test/library-tests/regex/parse.expected b/cpp/ql/test/library-tests/regex/parse.expected index 2224556cd52..0f07ba72809 100644 --- a/cpp/ql/test/library-tests/regex/parse.expected +++ b/cpp/ql/test/library-tests/regex/parse.expected @@ -26,6 +26,14 @@ #-----| [RegExpConstant, RegExpNormalChar] b +#-----| [RegExpConstant, RegExpEscape] \c + +#-----| [RegExpConstant, RegExpNormalChar] Z + +#-----| [RegExpConstant, RegExpEscape] \c + +#-----| [RegExpConstant, RegExpNormalChar] A + #-----| [RegExpConstant, RegExpEscape] \u{987 #-----| [RegExpConstant, RegExpNormalChar] A @@ -163,6 +171,10 @@ #-----| 1 -> [RegExpConstant, RegExpEscape] \n #-----| 2 -> [RegExpConstant, RegExpNormalChar] b +#-----| [RegExpSequence] \cA +#-----| 0 -> [RegExpConstant, RegExpEscape] \c +#-----| 1 -> [RegExpConstant, RegExpNormalChar] A + #-----| [RegExpSequence] [[:alpha:]][[:digit:]] #-----| 0 -> [RegExpCharacterClass] [[:alpha:]] #-----| 1 -> [RegExpCharacterClass] [[:digit:]] @@ -279,6 +291,10 @@ #-----| 0 -> [RegExpConstant, RegExpNormalChar] 0 #-----| 1 -> [RegExpConstant, RegExpNormalChar] 9 +#-----| [RegExpCharacterClass] [\cZ] +#-----| 0 -> [RegExpConstant, RegExpEscape] \c +#-----| 1 -> [RegExpConstant, RegExpNormalChar] Z + #-----| [RegExpCharacterClass] [A-F[:digit:]a-f] #-----| 0 -> [RegExpCharacterRange] A-F diff --git a/cpp/ql/test/library-tests/regex/regexp.cpp b/cpp/ql/test/library-tests/regex/regexp.cpp index 3f8330a0a59..86352695dc5 100644 --- a/cpp/ql/test/library-tests/regex/regexp.cpp +++ b/cpp/ql/test/library-tests/regex/regexp.cpp @@ -76,6 +76,10 @@ std::regex r_posix4("[:digit:]"); // unicode std::regex r_uni("\\u{9879}"); +// control escapes +std::regex r_ctrl1("\\cA"); +std::regex r_ctrl2("[\\cZ]"); + // String literal spellings for location tests std::regex r_loc_plain("a\\nb"); std::basic_regex r_loc_L(L"abc"); diff --git a/cpp/ql/test/library-tests/regex/regexp.expected b/cpp/ql/test/library-tests/regex/regexp.expected index ddac96dd553..3f3c8b64604 100644 --- a/cpp/ql/test/library-tests/regex/regexp.expected +++ b/cpp/ql/test/library-tests/regex/regexp.expected @@ -32,6 +32,7 @@ term | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | A | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | A-F | RegExpCharacterRange | | file://:0:0:0:0 | A-F | RegExpCharacterRange | | file://:0:0:0:0 | A-F] | RegExpConstant,RegExpNormalChar | @@ -39,6 +40,7 @@ term | file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | F | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | Z | RegExpConstant,RegExpNormalChar | +| file://:0:0:0:0 | Z | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | [ | RegExpConstant,RegExpNormalChar | | file://:0:0:0:0 | [123] | RegExpCharacterClass | | file://:0:0:0:0 | [A-F[:digit:]a-f] | RegExpCharacterClass | @@ -48,6 +50,7 @@ term | file://:0:0:0:0 | [[:digit:]] | RegExpCharacterClass | | file://:0:0:0:0 | [[a-f] | RegExpCharacterClass | | file://:0:0:0:0 | [[a-f]A-F] | RegExpSequence | +| file://:0:0:0:0 | [\\cZ] | RegExpCharacterClass | | file://:0:0:0:0 | [\\w] | RegExpCharacterClass | | file://:0:0:0:0 | [\\w]+ | RegExpPlus | | file://:0:0:0:0 | [\|] | RegExpCharacterClass | @@ -67,6 +70,9 @@ term | file://:0:0:0:0 | \\] | RegExpConstant,RegExpEscape | | file://:0:0:0:0 | \\b | RegExpSpecialChar | | file://:0:0:0:0 | \\b!a\\B | RegExpSequence | +| file://:0:0:0:0 | \\c | RegExpConstant,RegExpEscape | +| file://:0:0:0:0 | \\c | RegExpConstant,RegExpEscape | +| file://:0:0:0:0 | \\cA | RegExpSequence | | file://:0:0:0:0 | \\d | RegExpCharacterClassEscape | | file://:0:0:0:0 | \\d\\D | RegExpSequence | | file://:0:0:0:0 | \\n | RegExpConstant,RegExpEscape | @@ -161,16 +167,20 @@ regExpNormalCharValue | file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A | A | +| file://:0:0:0:0 | A | A | | file://:0:0:0:0 | A-F] | A-F] | | file://:0:0:0:0 | F | F | | file://:0:0:0:0 | F | F | | file://:0:0:0:0 | Z | Z | +| file://:0:0:0:0 | Z | Z | | file://:0:0:0:0 | [ | [ | | file://:0:0:0:0 | \\D | D | | file://:0:0:0:0 | \\S | S | | file://:0:0:0:0 | \\W | W | | file://:0:0:0:0 | \\[ | [ | | file://:0:0:0:0 | \\] | ] | +| file://:0:0:0:0 | \\c | c | +| file://:0:0:0:0 | \\c | c | | file://:0:0:0:0 | \\d | d | | file://:0:0:0:0 | \\n | \n | | file://:0:0:0:0 | \\n | \n |