From 5c6172c5cfb4a314245cee451f23cf52d7ae64c8 Mon Sep 17 00:00:00 2001 From: Jerome67000 Date: Wed, 4 Oct 2017 13:29:44 +0200 Subject: [PATCH] [DOCS] Adds RegExMatch doc and RegEx fix typo --- doc/classes/RegEx.xml | 10 +++++----- doc/classes/RegExMatch.xml | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/classes/RegEx.xml b/doc/classes/RegEx.xml index 626f8f1a936..4577672c729 100644 --- a/doc/classes/RegEx.xml +++ b/doc/classes/RegEx.xml @@ -5,7 +5,7 @@ Class for finding text patterns in a string using regular expressions. It can not perform replacements. Regular expressions are a way to define patterns of text to be searched. Details on writing patterns are too long to explain here but the Internet is full of tutorials and detailed explanations. - Once created, the RegEx object needs to be compiled with the pattern before it can be used. The pattern must be escaped first for gdscript before it is escaped for the expression. For example: + Once created, the RegEx object needs to be compiled with the search pattern before it can be used. The search pattern must be escaped first for gdscript before it is escaped for the expression. For example: [code]var exp = RegEx.new()[/code] [code]exp.compile("\\d+")[/code] would be read by RegEx as [code]\d+[/code] @@ -47,7 +47,7 @@ - Compiles and assign the regular expression pattern to use. + Compiles and assign the search pattern to use. @@ -68,14 +68,14 @@ - Returns the expression used to compile the code. + Returns the search pattern used to compile the code. - Returns whether this object has a valid regular expression assigned. + Returns whether this object has a valid search pattern assigned. @@ -88,7 +88,7 @@ - Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching reult if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. + Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise null. The region to search within can be specified without modifying where the start and end anchor would be. diff --git a/doc/classes/RegExMatch.xml b/doc/classes/RegExMatch.xml index 9e021ed6c8d..abf2e383d56 100644 --- a/doc/classes/RegExMatch.xml +++ b/doc/classes/RegExMatch.xml @@ -1,8 +1,10 @@ + Contains the results of a regex search. + Contains the results of a regex search. [method RegEx.search] returns an instance of [code]RegExMatch[/code] if it finds the search pattern in the [source] string. @@ -15,7 +17,7 @@ - Returns the end position of the match in the string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). + Returns the end position of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). @@ -38,7 +40,7 @@ - Returns the starting position of the match in the string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). + Returns the starting position of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). @@ -47,19 +49,21 @@ - Returns the result of the match in the string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). + Returns the result of the match in the [source] string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). + Returns an [Array] of the matches in the [source] string. + Returns the [source] string used with the search pattern to find this matching result.