split_regex()

Search
Feedback

Usage

split_regex(string, separator)

Description
Uses the given separator to split the given string into a collection of strings. This is the opposite of join().

The default separator is a regular expression which splits the string at any of the following characters:

, ; <whitespace>

The optional second parameter is used as regex. To use a literal string as separator, see split().

Examples

Any of these expressions

${split('one,two,three')}
${split('one;two;three')}
${split('one two three')}
${split('one::two::three', '::')}
${split('one.two.three', '\\.')}

results in

[one, two, three]

Graph-Browser

Related Articles
About this article
Last change 2016-08-29
Topics 2.0.2FrontendFunctionsStructr 2.0