File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp/regex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -622,7 +622,7 @@ private module Impl implements RegexTreeViewSig {
622622 /**
623623 * Holds if this is a unicode escape.
624624 */
625- private predicate isUnicode ( ) { this .getText ( ) .prefix ( 2 ) = "\\u" }
625+ private predicate isUnicode ( ) { this .getText ( ) .matches ( "\\u%" ) }
626626
627627 /**
628628 * Gets the unicode char for this escape.
@@ -636,7 +636,7 @@ private module Impl implements RegexTreeViewSig {
636636 /**
637637 * Holds if this is a hex escape.
638638 */
639- private predicate isHex ( ) { this .getText ( ) .prefix ( 2 ) = "\\x" }
639+ private predicate isHex ( ) { this .getText ( ) .matches ( "\\x%" ) }
640640
641641 /**
642642 * Gets the unicode char for this escape.
@@ -650,7 +650,7 @@ private module Impl implements RegexTreeViewSig {
650650 /**
651651 * Holds if this is a `\cX` escape.
652652 */
653- private predicate isControl ( ) { this .getText ( ) .prefix ( 2 ) = "\\c" }
653+ private predicate isControl ( ) { this .getText ( ) .matches ( "\\c%" ) }
654654
655655 /**
656656 * Gets the unicode char for this escape.
You can’t perform that action at this time.
0 commit comments