summaryrefslogtreecommitdiff
path: root/modules/regex
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-12 09:00:20 +0100
committerGitHub <noreply@github.com>2018-01-12 09:00:20 +0100
commite24f2c6489afdccc6268008d3dcc1ff4ad8ea71c (patch)
treeee8faddef95f8bcb66acfce729a6f85513740b2d /modules/regex
parent00630479dd5e5aa95915fddf7df9c6b11f525b0e (diff)
parentad79c703008394a360eb9875196a9414e1c84585 (diff)
Merge pull request #15611 from bojidar-bg/x-bind-more-properties
Bind many more properties to scripts
Diffstat (limited to 'modules/regex')
-rw-r--r--modules/regex/doc_classes/RegExMatch.xml32
-rw-r--r--modules/regex/regex.cpp4
2 files changed, 15 insertions, 21 deletions
diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml
index 0217099ce6..b84a98ff6d 100644
--- a/modules/regex/doc_classes/RegExMatch.xml
+++ b/modules/regex/doc_classes/RegExMatch.xml
@@ -28,13 +28,6 @@
Returns the number of capturing groups.
</description>
</method>
- <method name="get_names" qualifiers="const">
- <return type="Dictionary">
- </return>
- <description>
- Returns a dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one.
- </description>
- </method>
<method name="get_start" qualifiers="const">
<return type="int">
</return>
@@ -55,21 +48,18 @@
Returns an empty string if the group did not match or doesn't exist.
</description>
</method>
- <method name="get_strings" qualifiers="const">
- <return type="Array">
- </return>
- <description>
- Returns an [Array] of the match and its capturing groups.
- </description>
- </method>
- <method name="get_subject" qualifiers="const">
- <return type="String">
- </return>
- <description>
- Returns the source string used with the search pattern to find this matching result.
- </description>
- </method>
</methods>
+ <members>
+ <member name="names" type="Dictionary" setter="" getter="get_names">
+ A dictionary of named groups and its corresponding group number. Only groups with that were matched are included. If multiple groups have the same name, that name would refer to the first matching one.
+ </member>
+ <member name="strings" type="Array" setter="" getter="get_strings">
+ An [Array] of the match and its capturing groups.
+ </member>
+ <member name="subject" type="String" setter="" getter="get_subject">
+ The source string used with the search pattern to find this matching result.
+ </member>
+ </members>
<constants>
</constants>
</class>
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index 3fe7e36d45..6f2bb46fc8 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -156,6 +156,10 @@ void RegExMatch::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_string", "name"), &RegExMatch::get_string, DEFVAL(0));
ClassDB::bind_method(D_METHOD("get_start", "name"), &RegExMatch::get_start, DEFVAL(0));
ClassDB::bind_method(D_METHOD("get_end", "name"), &RegExMatch::get_end, DEFVAL(0));
+
+ ADD_PROPERTY(PropertyInfo(Variant::STRING, "subject"), "", "get_subject");
+ ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "names"), "", "get_names");
+ ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "strings"), "", "get_strings");
}
void RegEx::_pattern_info(uint32_t what, void *where) const {