Path: blob/master/modules/regex/doc_classes/RegExMatch.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="RegExMatch" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3Contains the results of a [RegEx] search.4</brief_description>5<description>6Contains the results of a single [RegEx] match returned by [method RegEx.search] and [method 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 substring for you.7</description>8<tutorials>9</tutorials>10<methods>11<method name="get_end" qualifiers="const">12<return type="int" />13<param index="0" name="name" type="Variant" default="0" />14<description>15Returns 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.16Returns -1 if the group did not match or doesn't exist.17</description>18</method>19<method name="get_group_count" qualifiers="const">20<return type="int" />21<description>22Returns the number of capturing groups.23</description>24</method>25<method name="get_start" qualifiers="const">26<return type="int" />27<param index="0" name="name" type="Variant" default="0" />28<description>29Returns 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.30Returns -1 if the group did not match or doesn't exist.31</description>32</method>33<method name="get_string" qualifiers="const">34<return type="String" />35<param index="0" name="name" type="Variant" default="0" />36<description>37Returns the substring of the match from the source string. 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.38Returns an empty string if the group did not match or doesn't exist.39</description>40</method>41</methods>42<members>43<member name="names" type="Dictionary" setter="" getter="get_names" default="{}">44A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one.45</member>46<member name="strings" type="PackedStringArray" setter="" getter="get_strings" default="PackedStringArray()">47An [Array] of the match and its capturing groups.48</member>49<member name="subject" type="String" setter="" getter="get_subject" default="""">50The source string used with the search pattern to find this matching result.51</member>52</members>53</class>545556