godotengine / godotengine/godot-docs

Clearfy the usage of `String.match(expr)`

Open
#10,050 0 comments 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
Godot 3.6 & Godot 4.3

**Issue description:**
In the current explanation, it's unclear that which string should be wildcard pattern, i.e., whether the caller or the `expr` argument should be. (Same for `String.matchn(expr)`)
```
"abcdef".match("a?c*") # correct
"a?c*".match("abcdef") # wrong
```
Sample code or additional explanation such as "returns true if the string matches the pattern `expr`" would be helpful.

**URL to the documentation page:**
https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-match

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.