Regex split

I am using the “Text Regex Split” component from “Sasquatch” and I need to create a definition in which to split the name of the geometry into several parts and I get into a roadblock.

I managed to take the first part that I do need (the first number before “-” character) but can’t find a way to take the second parts that is the name of the geometry (between “-” & “[”) and the third part that it is the number of pieces I need (between square brackets “”)


Names_Split.gh (6.2 KB)

\-|\[|\] splits at - or [ or ]

it’s useful to split at last ] to get the clean value inside the square brackets:

instead of \-|\[ without the last |\], that would return:

1 Like

Why bother with Sasquatch when standard GH Text Split works fine?
Names_Split_2022Oct7a
Names_Split_2022Oct7a.gh (9.7 KB)

3 Likes

Thank you for both solutions.

Since regular expressions are great:

regexp_ftw.gh (10.3 KB)

3 Likes