Tokenizes a string according to a pattern.
The following construct(s) refer to this construct:
fn:tokenize(string $string, string $pattern) => string*
fn:tokenize(string $string, string $pattern, string $flags) => string*
This function breaks the input $string
into a sequence of strings, treating any substring that matches
$pattern
as a separator. The separators themselves are not returned.
The $flag
argument is interpreted in the same way as for the fn:matches() function.
$string |
a string to be tokenized |
---|---|
$pattern |
a separator pattern |
$flags |
modifiers for patternmatching |
fn:tokenize("Some unparsed <br> HTML <br> text", "\s*<br>\s*", "i")
The query returns ("Some unparsed", "HTML", "text") the pattern "\s*" denoting any number of whitespace characters.