瀏覽代碼

Merge pull request #39551 from mrushyendra/regex_class_doc

[Doc] Fix RegEx expression result
Rémi Verschelde 5 年之前
父節點
當前提交
6368d7b97d
共有 2 個文件被更改,包括 2 次插入3 次删除
  1. 1 2
      modules/regex/doc_classes/RegEx.xml
  2. 1 1
      modules/regex/doc_classes/RegExMatch.xml

+ 1 - 2
modules/regex/doc_classes/RegEx.xml

@@ -32,8 +32,7 @@
 		[codeblock]
 		[codeblock]
 		for result in regex.search_all("d01, d03, d0c, x3f and x42"):
 		for result in regex.search_all("d01, d03, d0c, x3f and x42"):
 		    print(result.get_string("digit"))
 		    print(result.get_string("digit"))
-		# Would print 01 03 3f 42
-		# Note that d0c would not match
+		# Would print 01 03 0 3f 42
 		[/codeblock]
 		[/codeblock]
 		[b]Note:[/b] Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] library. You can view the full pattern reference [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url].
 		[b]Note:[/b] Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] library. You can view the full pattern reference [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url].
 		[b]Tip:[/b] You can use [url=https://regexr.com/]Regexr[/url] to test regular expressions online.
 		[b]Tip:[/b] You can use [url=https://regexr.com/]Regexr[/url] to test regular expressions online.

+ 1 - 1
modules/regex/doc_classes/RegExMatch.xml

@@ -49,7 +49,7 @@
 	</methods>
 	</methods>
 	<members>
 	<members>
 		<member name="names" type="Dictionary" setter="" getter="get_names" default="{}">
 		<member name="names" type="Dictionary" setter="" getter="get_names" default="{}">
-			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.
+			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.
 		</member>
 		</member>
 		<member name="strings" type="Array" setter="" getter="get_strings" default="[  ]">
 		<member name="strings" type="Array" setter="" getter="get_strings" default="[  ]">
 			An [Array] of the match and its capturing groups.
 			An [Array] of the match and its capturing groups.