From c12e0a413312a19ac329641c31991d70a6442b48 Mon Sep 17 00:00:00 2001 From: laikq <55911173+laikq@users.noreply.github.com> Date: Tue, 26 May 2026 17:04:48 +0200 Subject: [PATCH] Website: Fix API/string examples for regex (#2001) --- website/API/string.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/API/string.md b/website/API/string.md index 10b27b6a..8102cefd 100644 --- a/website/API/string.md +++ b/website/API/string.md @@ -240,7 +240,7 @@ Matches string `s` against a JavaScript regular expression pattern and returns t Example: ```lua local match = string.matchRegex("hello123", "([a-z]+)([0-9]+)") -print(match[1], match[2]) -- prints: hello 123 +print(match[1], match[2], match[3]) -- prints: hello123 hello 123 ``` ### string.matchRegexAll(s, pattern) @@ -249,7 +249,7 @@ Returns an iterator that finds all matches of a JavaScript regular expression pa Example: ```lua for match in string.matchRegexAll("a1b2c3", "([a-z])([0-9])") do - print(match[0], match[1], match[2]) -- prints each full match and its capture groups + print(match[1], match[2], match[3]) -- prints each full match and its capture groups end -- Output: -- a1 a 1