The tokenize() function splits a string into a sequence of substrings, by looking for separators that match a given regular expression. For example, «tokenize("12, 16, 2", ",\s*") » returns the sequence «("12", "16", "2") » .
Argument | Data Type | Meaning |
---|---|---|
input | xs:string? | The input string. If an empty sequence or zero-length string is supplied, the function returns an empty sequence |
regex | xs:string | The regular expression used to match separators. Note that this must not be a regular expression that matches a zero-length string |
flags (optional) | xs:string | One or more letters indicating options on how the matching is to be performed. If this argument is omitted, the effect is the same as supplying a zero-length string, which defaults all the option settings. The flags are the same as for the <xsl:analyze-string> instruction described on page 176 |
Result | xs:string* | A sequence whose items are substrings of the input string |