Skip to content

XQuery tokenize Function

How the XQuery tokenize function splits strings into sequences using regular expressions, with syntax and practical usage examples.

XQuery tokenize Function

The tokenize function returns a sequence of items matching the regular expression.

Syntax

tokenize($input, $regex)

Input Parameters

  • $input is the input string.
  • $regex is the regular expression.

Example

XQuery Expressionxquery
let $input := 'Chapter 1 ... Chapter 2... Section 1.1'
return ( tokenize($input, 'C'))
Outputxml
hapter 1 ... 
hapter 2... Section 1.1
Navigation