Signature
bool regex_match(String pattern, String subject) bool regex_match(String pattern, String subject, String flags)
Parameters
pattern : PCRE2 regular expression pattern
subject : string to test
flags : optional regex flags
return value :
true when the entire subject matches the patternTests 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:
Supported flags:
ienables case-insensitive matching.menables multiline^and$.slets.match newlines.xenables extended / whitespace-insensitive pattern syntax.uexplicitly enables UTF-8 and Unicode character properties.adisables 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.
Example
print(regex_match("^[a-z]+$", "docs") ? "match\n" : "no\n");
Output
match