CodeQL library for JavaScript
Search

Module RegExp

Import path

import javascript

Predicates

alwaysMatchesMetaCharacter

Holds if term can match any occurence of char within a string (not taking into account the context in which term appears).

getRegExpFromNode

Gets the AST of a regular expression that can flow to node, including RegExp objects as well as strings interpreted as regular expressions.

getRegExpObjectFromNode

Gets the AST of a regular expression object that can flow to node.

isDotAll

Holds if flags includes the s flag.

isFullyAnchoredTerm

Holds if term and all of its disjuncts are anchored on both ends.

isGenericRegExpSanitizer

Holds if term is a generic sanitizer for strings that match (if outcome is true) or strings that don’t match (if outcome is false).

isGlobal

Holds if flags includes the g flag.

isIgnoreCase

Holds if flags includes the i flag.

isMultiline

Holds if flags includes the m flag.

isWildcardLike

Holds if term matches any character except for explicitly listed exceptions.

maybeDotAll

Holds if flags includes the s flag or is the unknown flag ?.

maybeGlobal

Holds if flags includes the g flag or is the unknown flag ?.

maybeIgnoreCase

Holds if flags includes the i flag or is the unknown flag ?.

maybeMultiline

Holds if flags includes the m flag or is the unknown flag ?.

unknownFlag

Gets the string "?" used to represent a regular expression whose flags are unknown.

Classes

MetaCharacter

A character that will be analyzed by RegExp::alwaysMatchesMetaCharacter.