UCE Docs / regex_split

Signature

StringList regex_split(String pattern, String subject)
StringList regex_split(String pattern, String subject, String flags)

Parameters

pattern : PCRE2 regular expression pattern used as the separator
subject : string to split
flags : optional regex flags
return value : a list of string parts

Splits subject wherever pattern matches.

Example:

This is the pattern-aware companion to split().

Behavior notes:

  • Separators are removed from the returned list.

  • Empty fields are preserved.

  • If the pattern does not match, the result contains the original subject as a single item.

  • Zero-length separators are handled safely to avoid infinite loops.

Example

print(join(regex_split("\\s+", "uce docs api"), ","), "\n");
Output
uce,docs,api