44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
:sig
|
|
bool regex_match(String pattern, String subject)
|
|
bool regex_match(String pattern, String subject, String flags)
|
|
|
|
:params
|
|
pattern : PCRE2 regular expression pattern
|
|
subject : string to test
|
|
flags : optional regex flags
|
|
return value : `true` when the entire subject matches the pattern
|
|
|
|
:see
|
|
>regex
|
|
regex_search
|
|
regex_search_all
|
|
regex_replace
|
|
regex_split
|
|
String
|
|
|
|
:content
|
|
Tests whether `subject` matches `pattern` from start to end.
|
|
|
|
This is a full-string match, not a substring search. Use `regex_search()` when you want to find the first occurrence anywhere in a string.
|
|
|
|
Examples:
|
|
|
|
```uce
|
|
regex_match("[A-Z][a-z]+", "Alice"); // true
|
|
regex_match("[A-Z][a-z]+", "Alice!"); // false
|
|
regex_match("\\d{4}-\\d{2}-\\d{2}", "2026-04-29");
|
|
```
|
|
|
|
Supported flags:
|
|
|
|
- `i` enables case-insensitive matching.
|
|
- `m` enables multiline `^` and `$`.
|
|
- `s` lets `.` match newlines.
|
|
- `x` enables extended / whitespace-insensitive pattern syntax.
|
|
- `u` explicitly enables UTF-8 and Unicode character properties.
|
|
- `a` disables UTF-8 / Unicode property mode for ASCII-oriented matching.
|
|
|
|
UCE uses PCRE2 in UTF-8 + Unicode-property mode by default, so patterns such as `\\p{L}+` work naturally on Unicode text.
|
|
|
|
Invalid patterns or invalid flags raise a request-visible runtime error with the PCRE2 diagnostic message.
|