Loading TOC...

MarkLogic 9 Product Documentation
fn:tokenize

fn:tokenize(
   $input as xs:string?,
   $pattern as xs:string,
   [$flags as xs:string]
) as xs:string*

Summary

Returns a sequence of strings constructed by breaking the specified input into substrings separated by the specified $pattern. The specified $pattern is not returned as part of the returned items.

Parameters
input The string to tokenize.
pattern The regular expression pattern from which to separate the tokens.
flags The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.

Example

fn:tokenize("this is a string", " ")

=> returns the sequence ("this", "is", "a", "string")

fn:tokenize("this is a string", " ")[last()]

=> string

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.