CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.2.1-dev (changelog, source)
Search

Module signature RegexTreeViewSig

A signature describing the syntax tree of regular expressions.

Import path

import codeql.regex.RegexTreeView

Predicates

isDotAll

Holds if root has the s flag for multi-line matching.

isEscapeClass

Holds if term is an escape class representing e.g. \d. clazz is which character class it represents, e.g. “d” for \d.

isExcluded

Holds if the regular expression should not be considered.

isIgnoreCase

Holds if root has the i flag for case-insensitive matching.

isPossessive

Holds if term is a possessive quantifier. As javascript’s regexes do not support possessive quantifiers, this never holds, but is used by the shared library.

matchesAnyPrefix

Holds if the regex that term is part of is used in a way that ignores any leading prefix of the input it’s matched against. Not yet implemented for JavaScript.

matchesAnySuffix

Holds if the regex that term is part of is used in a way that ignores any trailing suffix of the input it’s matched against. Not yet implemented for JavaScript.

Types

InfiniteRepetitionQuantifier

A regular expression term that permits unlimited repetitions.

RegExpAlt

An alternative term, that is, a term of the form a|b.

RegExpAnchor

A term that matches a specific position between characters in the string.

RegExpBackRef

A back reference, that is, a term of the form \i or \k<name> in a regular expression.

RegExpCaret

A caret assertion ^ matching the beginning of a line.

RegExpCharEscape

A character escape in a regular expression.

RegExpCharacterClass

A character class in a regular expression.

RegExpCharacterClassEscape

A character class escape in a regular expression.

RegExpCharacterRange

A character range in a character class in a regular expression.

RegExpConstant

A constant regular expression term, that is, a regular expression term matching a single string.

RegExpDollar

A dollar assertion $ matching the end of a line.

RegExpDot

A dot regular expression.

RegExpEscape

An escaped regular expression term, that is, a regular expression term starting with a backslash.

RegExpGroup

A grouped regular expression.

RegExpLiteral

A regular expression literal.

RegExpLookahead

A zero-width lookahead assertion.

RegExpLookbehind

A zero-width lookbehind assertion.

RegExpNonWordBoundary

A non-word boundary, that is, a regular expression term of the form \B.

RegExpOpt

An optional term.

RegExpParent

An element containing a regular expression term, that is, either a string literal (parsed as a regular expression; the root of the parse tree) or another regular expression term (a descendant of the root).

RegExpPlus

A plus-quantified term.

RegExpPositiveLookahead

A positive-lookahead assertion.

RegExpPositiveLookbehind

A positive-lookbehind assertion.

RegExpQuantifier

A quantified regular expression term.

RegExpRange

A range-quantified term

RegExpSequence

A sequence term.

RegExpStar

A star-quantified term.

RegExpSubPattern

A zero-width lookahead or lookbehind assertion.

RegExpTerm

A regular expression term, that is, a syntactic part of a regular expression. These are the tree nodes that form the parse tree of a regular expression literal.

RegExpWordBoundary

A word boundary assertion.

Top

An element used in some way as or in a regular expression. This class exists to have a common supertype that all languages can agree on.