cleanup, docs

This commit is contained in:
root
2026-06-16 12:21:31 +00:00
parent dff1959341
commit ea08d5f28b
296 changed files with 1571 additions and 1940 deletions
+4 -7
View File
@@ -10,6 +10,7 @@ flags : optional regex flags
return value : a new string with all matches replaced
:see
>string
>regex
regex_match
regex_search
@@ -22,16 +23,12 @@ Replaces every match of `pattern` in `subject` and returns the transformed strin
Example:
```uce
String html = regex_replace(
"@([A-Za-z0-9_]+)",
"<a href=\"/users/$1\">@$1</a>",
"Hello @alice and @bob"
);
```
Replacement strings use PCRE2 substitution syntax, including numbered capture references such as `$1` and named references such as `${name}`.
For simple literal search-and-replace, use `replace()`. Use `regex_replace()` when the match condition needs a pattern, captures, character classes, anchors, or flags.
Invalid patterns, invalid flags, or invalid substitution syntax raise a request-visible runtime error.
:example
print(regex_replace("docs", "manual", "uce docs"), "\n");