Function Block PREG_SPLIT

The Function Block PREG_SPLIT splits a string according to a regular expression.

Note: This function is Binary-Safe. This means that UTF8 characters cannot be processed directly.

Note: This Function Block can have more than four outputs. You can right-click on the Function Block to add another output.

Note: For normal splits, the Function Block EXPLODE is recommended.

Input PATTERN

The expression to search for as a string.

Input SUBJECT

The string to be split.

Input LIMIT

If specified, at most LIMIT substrings are returned, with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit".

Input NO_EMPTY

If this input is true, the Function Block only returns parts that are not empty.

Input DELIM_CAPTURE

If this input is true, the parenthesized expressions of the delimiter search pattern are also captured and returned.

Input OFFSET_CAPTURE

If this input is true, with each match found, the corresponding offset in the string is returned. Note that this changes the return values accordingly.

Output ERR

Is true in case of an error.

Output COUNT

Returns the number of splits or the size of the internal array.

Outputs P0..P#

Further outputs can be added. Each split is transferred to one output. If the internal array is smaller than the number of outputs, the result on the larger outputs is NULL.

See Also