CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

Class RegExp

A StringlikeLiteral containing a regular expression term, that is, either a regular expression literal, or a string literal used in a context where it is parsed as regular expression.

Import path

import codeql.ruby.regexp.internal.ParseRegExp

Direct supertypes

Indirect supertypes

Known direct subtypes

    Predicates

    alternation

    Whether the text in the range start,end is an alternation

    alternationOption

    Whether the text in the range start,end is an alternation and the text in partStart, partEnd is one of the options in that alternation.

    backreference

    Whether the text in the range start,end is a back reference

    charRange

    Holds if the character set starting at charset_start contains a character range with lower bound found between start and lowerEnd and upper bound found between upperStart and end.

    charSet

    Whether there is a character class, between start (inclusive) and end (exclusive)

    charSetChild

    Holds if the character set starting at charsetStart contains either a character or a range found between start and end.

    charSetDelimiter

    Helper predicate for chars that could be character-set delimiters. Holds if the (non-escaped) char at pos in the string, is the (one-based) index occurrence of a bracket ([ or ]) in the string. Result if true is the char is [, and false if the char is ].

    charSetStart

    Helper predicate for charSetStart(int start, int end).

    charSetStart

    Holds if a character set starts between start and end.

    character

    Holds if a simple or escaped character is found between start and end.

    emptyGroup

    Holds if an empty group is found between start and end.

    escapedCharacter

    Holds if an escaped character is found between start and end. Escaped characters include hex values, octal values and named escapes, but excludes backreferences.

    escapingChar

    Holds if the character at pos is a "" that is actually escaping what comes after.

    failedToParse

    Holds if the ith character could not be parsed.

    firstItem

    Whether the item at [start, end) is one of the first items to be matched.

    getBackRefName

    Gets the name, if it has one, of the back reference in start,end

    getBackRefNumber

    Gets the number of the back reference in start,end

    getChar

    Gets the ith character of this regex

    getCharacterPropertyName

    Gets the name of the character property in start,end

    getFlags

    Gets the flags for this RegExp, or the empty string if it has no flags.

    getGroupName

    Gets the name, if it has one, of the group in start,end

    getGroupNumber

    Gets the number of the group in start,end

    getText

    Gets the text of this regex

    group

    Whether the text in the range start,end is a group

    groupContents

    Matches the contents of a group.

    inCharSet

    Holds if the character at index is inside a character set.

    inPosixBracket

    Holds if the character at index is inside a posix bracket.

    isDotAll

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

    isIgnoreCase

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

    item

    Holds if the range start, end contains a character, a quantifier, a character set or a group.

    lastItem

    Whether the item at [start, end) is one of the last items to be matched.

    multiples

    Holds if a repetition quantifier is found between start and end, with the given lower and upper bounds. If a bound is omitted, the corresponding string is empty.

    namedBackreference

    Matches a named backreference, e.g. \k<foo>.

    namedCharacterProperty

    Matches named character properties such as \p{Word} and [[:digit:]]

    namedCharacterPropertyIsInverted

    Holds if the named character property is inverted. Examples for which it holds: - \P{Digit} upper-case P means inverted - \p{^Word} caret also means inverted - [[:^digit:]]

    negativeLookaheadAssertionGroup

    Holds if a negative lookahead is found between start and end

    negativeLookbehindAssertionGroup

    Holds if a negative lookbehind is found between start and end

    nonEscapedCharAt

    Gets the ith character of this regex, unless it is part of a character escape sequence.

    normalCharacter

    Holds if a normal character is found between start and end.

    normalCharacterSequence

    Holds if the range [start:end) consists of only ‘normal’ characters.

    numberedBackreference

    Matches a numbered backreference, e.g. \1.

    positiveLookaheadAssertionGroup

    Holds if a positive lookahead is found between start and end

    positiveLookbehindAssertionGroup

    Holds if a positive lookbehind is found between start and end

    qualifiedItem

    Whether the text in the range start,end is a qualified item, where item is a character, a character set or a group.

    qualifiedPart

    Holds if a qualified part is found between start and partEnd and the qualifier is found between partEnd and end.

    sequence

    Whether the text in the range start,end is a sequence of 1 or more items, where an item is a character, a character set or a group.

    specialCharacter

    Holds if a special character is found between start and end.

    zeroWidthMatch

    Whether the text in the range start, end is a group and can match the empty string.

    Inherited predicates

    getAChild

    Gets a child node of this AstNode.

    from AstNode
    getAChild

    Gets a child of this node, which can also be retrieved using a predicate named pred.

    from StringlikeLiteral
    getAControlFlowEntryNode

    Gets a control-flow entry node for this statement, if any

    from Stmt
    getAControlFlowNode

    Gets a control-flow node for this statement, if any.

    from Stmt
    getAPrimaryQlClass

    Gets the name of a primary CodeQL class to which this node belongs.

    from AstNode
    getCfgScope

    Gets the control-flow scope of this statement, if any.

    from Stmt
    getComponent

    Gets the nth component of this string or string-like literal. The result will be one of StringTextComponent, StringInterpolationComponent, and StringEscapeSequenceComponent.

    from StringlikeLiteral
    getConstantValue

    Gets the constant value of this expression, if any.

    from Expr
    getDesugared

    Gets the desugared version of this AST node, if any.

    from AstNode
    getEnclosingCallable

    Gets the enclosing callable, if any.

    from Stmt
    getEnclosingMethod

    Gets the enclosing method, if any.

    from AstNode
    getEnclosingModule

    Gets the enclosing module, if any.

    from AstNode
    getEnclosingToplevel

    Gets the enclosing top-level.

    from AstNode
    getFile

    Gets the file of this node.

    from AstNode
    getLocation

    Gets the location of this node.

    from AstNode
    getNumberOfComponents

    Gets the number of components in this string or string-like literal.

    from StringlikeLiteral
    getParent

    Gets the parent of this AstNode, if this node is not a root node.

    from AstNode
    getPrimaryQlClasses

    Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

    from AstNode
    isSynthesized

    Holds if this node was synthesized to represent an implicit AST node not present in the source code. In the following example method call, the receiver is an implicit self reference, for which there is a synthesized Self node.

    from AstNode
    toString

    Gets a textual representation of this node.

    from AstNode