Split with multiple delimiters

Hi!

I want to split an input who can comes from a form with different delimeters.
Now I have a split only with “,” delimeter but I want to change for any delimeter:

For example:
input1, input2 input3; input 4
input 5

In this example the are four different delimeters: comma, space, semicolon and break line.

Please, help!
Thanks in advance.

You’ll need to use a Text Parser Match Pattern module with a regular expression if your string contains multiple delimiters.

3 Likes

Thanks @samliew! Got it.
What could be the regular expression for these delimeters: comma, space, semicolon, line break and new line?

Are you certain you want to split by spaces?

Then your example

input1, input2 input3; input 4
input 5

Will turn out to have seven matches, not the five you were expecting

Screenshot_2023-12-20_211229

You can use a Text Parser “Match Pattern” module with this regular expression pattern

[^,\s;\n]+?(?=[,\s;\n]+|$)

Regex test: https://regex101.com/r/ifYVY1

Important Info

  • :warning: Global match must be set to YES!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps!

3 Likes

You rock @samliew!
Thank you so much for your help.

2 Likes