Regex Split

Hello,
I have a problem with regex.
how can i split theses strings by using regex into 3 groups ? Groups by first three occurrence of " - "?

aa - sdd - aaddd - aa
11 - dsad - aaa - 2323 - aad
333 - ssss - sadsadsa - sdsa- sa
Group1: 
aa
11
333
Group2:
sdd
dsad
ssss
Group3:
aaddd - aa
aaa - 2323 - aad
sadsadsa - sdsa- sa

Thanks for help…

Hi @Tim8200 ,
this regex should do the job ^(.+?) - (.+?) - (.+)$
Try it yourself here https://regexr.com/

1 Like

The following Regex worked for me, but it could probably be simplified:

^([0-9a-zA-Z]{1,}).-.([0-9a-zA-Z]{1,}).-.([0-9a-zA-Z]{1,}.+)

image

I like the Regex Extractor node for this because you can see the results in real time:

image

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.