tokenize-regexp

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Functions > Function Library Reference > core | string functions >

tokenize-regexp

Result is the input string split into a sequence of strings, where the supplied regular expression pattern match defines the separator. The separator strings are not output by the result parameter. Optional flags may also be used.

fn-tokenize-regex

regex1

 

In the example shown above, input string is a succession of characters separated by spaces and/or commas, i.e.

 

a ,  b c,d

 

The regex pattern defines a character class ["space""comma"] - of which one and only one character will be matched in a character class, i.e. either space or comma.

 

The + quantifier specifies "one or more" occurrences of the character class/string.

 

The result string is:

regex2

Notes:

There are slight differences in regular expression syntax between the various languages.
Tokenize-regexp in C++ is only available in Visual Studio 2008 SP1 and later.

 

For more information, see Regular expressions.


© 2019 Altova GmbH