split text(regex)

This function splits a text into elements using a regular expression. Split elements are added to a list. The result of the function is the number of elements being added to the list.

If the regular expression contains groups, only the values that are contained in the groups are added to the list. If the regular expression does not contain groups, the expression is regarded as a separator and all individual values determined after the split are added.

Parameters


Parameter

Description

a

Text to be split.

b

Regular expression.

c

Name of the list. Default: "default". Important note: Already existing elements in the list are not removed. Note: If the specified list does not yet exist, it is created automatically.

d

(optional) "true" if leading and trailing spaces should be removed from the elements before being added to the list. Default: "false".


Examples


The individual examples are based on initially empty lists.


Parameter a

Parameter b

Parameter c

Parameter d

Result

Values in list after split

abc

,



1

default: {abc}

abc,def;ghi

[,;]

mylist


3

mylist: {abc,def,ghi}

abc , def ; ghi

[,;]

mylist


3

mylist: { abc , def , ghi }

abc , def ; ghi

[,;]

mylist

true

3

mylist: {abc,def,ghi}

12a45c890

(\d{2,3})\D{1}(\d{2,3})\D{1}(\d{2,3})

mylist


3

mylist: {12,45,890}