mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
use more set literals instead of big disjunctions
This commit is contained in:
@@ -14,13 +14,16 @@ import javascript
|
||||
* Gets a regular expression pattern that matches the syntax of likely regular expressions.
|
||||
*/
|
||||
private string getALikelyRegExpPattern() {
|
||||
result = "/.*/[gimuy]{1,5}" or // pattern with at least one flag: /foo/i
|
||||
result = "/\\^.*/[gimuy]{0,5}" or // pattern with anchor: /^foo/
|
||||
result = "/.*\\$/[gimuy]{0,5}" or // pattern with anchor: /foo$/
|
||||
result = "\\^.*\\$" or // pattern body with anchors: ^foo$
|
||||
result = ".*(?<!\\\\)\\\\[dDwWsSB].*" or // contains a builtin character class: \s
|
||||
result = ".*(?<!\\\\)\\\\[\\[\\]()*+?{}|^$.].*" or // contains an escaped meta-character: \(
|
||||
result = ".*\\[\\^?[\\p{Alnum}\\p{Blank}_-]+\\][*+].*" // contains a quantified custom character class: [^a-zA-Z123]+
|
||||
result =
|
||||
[
|
||||
"/.*/[gimuy]{1,5}", // pattern with at least one flag: /foo/i
|
||||
"/\\^.*/[gimuy]{0,5}", // pattern with anchor: /^foo/
|
||||
"/.*\\$/[gimuy]{0,5}", // pattern with anchor: /foo$/
|
||||
"\\^.*\\$", // pattern body with anchors: ^foo$
|
||||
".*(?<!\\\\)\\\\[dDwWsSB].*", // contains a builtin character class: \s
|
||||
".*(?<!\\\\)\\\\[\\[\\]()*+?{}|^$.].*", // contains an escaped meta-character: \(
|
||||
".*\\[\\^?[\\p{Alnum}\\p{Blank}_-]+\\][*+].*" // contains a quantified custom character class: [^a-zA-Z123]+
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user