Houdini 21.0 Nodes APEX nodes

string::RegexSplit

Splits a string based on a regular expression.

On this page
Since 21.0

Returns True if at least one split has occurred. Returns False if regex is not found in input, or regex is invalid. If the split is successful, an array of the substrings found between the matches of regex is returned.

Note

This behaves differently from Python and other split methods in how it handles trailing delimiters, for example, string::RegexSplit splits “a,b,” into two strings, “a” and “b”. You can augment regex with |($(?!\s)) to split “a,b,” into three tokens.

Inputs

regex: String

The regular expression.

input: String

The string to split.

maxsplits: Int

The maximum number of splits allowed. Defaults to 0, which means there is no limit to the number of splits.

Outputs

success: Bool

Returns True if there is at least one split.

results: StringArray

The substrings between matches of regex.

See also

APEX nodes