CodeQL library for Python
codeql/python-all 0.11.14 (changelog, source)
Search

Class Impl::RegExpTerm

A regular expression term, that is, a syntactic part of a regular expression.

Import path

import semmle.python.regexp.RegexTreeView

Direct supertypes

Indirect supertypes

Known direct subtypes

Fields

Predicates

getChild

Gets the ith child term.

getEnd

Gets the offset at which this term ends.

getFile

Gets the file in which this term is found.

getLiteral

Gets the string literal in which this term is found.

getLocation

Gets the location of the surrounding regex, as locations inside the regex do not exist. To get location information corresponding to the term inside the regex, use hasLocationInfo.

getParent

Gets the parent term of this regular expression term, or the regular expression literal if this is the root term.

getPart

Gets the StringPart in which this RegExpTerm resides, if any. localOffset will be the offset of this RegExpTerm inside result.

getPredecessor

Gets the regular expression term that is matched (textually) before this one, if any.

getPrimaryQLClass

Gets the primary QL class for this term.

getRawValue

Gets the raw source text of this term.

getRegex

Gets the associated regex.

getRootTerm

Gets the outermost term of this regular expression.

getStart

Gets the offset at which this term starts.

getSuccessor

Gets the regular expression term that is matched (textually) after this one, if any.

hasLocationInfo

Holds if this term is found at the specified location offsets.

isRootTerm

Holds if this is the root term of a regular expression.

isUsedAsRegExp

Holds if this term is part of a string literal that is interpreted as a regular expression.

toString

Gets a textual representation of this element.

Inherited predicates

getAChild

Gets a child term .

from RegExpParent
getLastChild

Gets the last child term of this element.

from RegExpParent
getNumChild

Gets the number of child terms.

from RegExpParent

Charpred