godot/modules/regex/doc_classes/RegExMatch.xml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
2.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
<class name="RegExMatch" inherits="RefCounted" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Contains the results of a [RegEx] search.
</brief_description>
<description>
Contains 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.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_end" qualifiers="const">
<return type="int" />
<param index="0" name="name" type="Variant" default="0" />
<description>
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.
Returns -1 if the group did not match or doesn't exist.
</description>
</method>
<method name="get_group_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of capturing groups.
</description>
</method>
<method name="get_start" qualifiers="const">
<return type="int" />
<param index="0" name="name" type="Variant" default="0" />
<description>
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.
</description>
</method>
<method name="get_string" qualifiers="const">
<return type="String" />
<param index="0" name="name" type="Variant" default="0" />
<description>
Returns 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.
Returns an empty string if the group did not match or doesn't exist.
</description>
</method>
</methods>
2018-01-12 06:38:35 +08:00
<members>
2019-07-16 02:42:47 +08:00
<member name="names" type="Dictionary" setter="" getter="get_names" default="{}">
A 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.
2018-01-12 06:38:35 +08:00
</member>
2022-09-01 01:24:04 +08:00
<member name="strings" type="PackedStringArray" setter="" getter="get_strings" default="PackedStringArray()">
2018-01-12 06:38:35 +08:00
An [Array] of the match and its capturing groups.
</member>
<member name="subject" type="String" setter="" getter="get_subject" default="&quot;&quot;">
2018-01-12 06:38:35 +08:00
The source string used with the search pattern to find this matching result.
</member>
</members>
</class>