commit 978d125c6a085a60ebcd1513b445131890ca534e
parent ff39595b6450cbed3334d5b8c2de410c4c68a4c6
Author: Vlad-Stefan Harbuz <vlad@vladh.net>
Date: Sat, 30 Apr 2022 22:30:57 +0200
correct regex::find and ::findall docstrings
Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/regex/regex.ha b/regex/regex.ha
@@ -770,7 +770,7 @@ fn search(
// Attempts to match a regular expression against a string and returns the
-// either the longest leftmost match or all matches.
+// longest leftmost match, or void if there is no match.
export fn find(re: regex, string: str) (void | []matchgroup | error) = {
let str_idx = -1;
let str_iter = strings::iter(string);
@@ -778,7 +778,7 @@ export fn find(re: regex, string: str) (void | []matchgroup | error) = {
};
// Attempts to match a regular expression against a string and returns all
-// non-overlapping matches.
+// non-overlapping matches, or void if there are no matches.
export fn findall(re: regex, string: str) (void | [][]matchgroup | error) = {
let res: [][]matchgroup = [];
let str_idx = -1;