RegExMatch

    Category: Core

    Contains the results of a regex search.

    Properties

    Description

    Contains the results of a single regex match returned by and RegEx.search_all. It can be used to find the position and range of the match and its capturing groups, and it can extract its sub-string for you.

    • names

    An Array of the match and its capturing groups.


    • subject

    The source string used with the search pattern to find this matching result.

    Method Descriptions

    • int get_end ( name=0 ) const

    Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it’s a named group). The default value of 0 refers to the whole pattern.


    • int get_group_count ( ) const

    Returns the number of capturing groups.


    Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it’s a named group). The default value of 0 refers to the whole pattern.

    Returns -1 if the group did not match or doesn’t exist.


    • get_string ( Variant name=0 ) const

    Returns an empty string if the group did not match or doesn’t exist.