I need to parse some text that has data enclosed within parentheses at the end of line.
Snarky Spark was at the stage with his team (Jerry Mander/Kodi Player/Bella Bella)
I need to extract the text within parantheses and separated by forward slash
in capture groups.
Jerry Mander
Kodi Player
Bella Bella
I have tried the following to split by /
(?:[^\/])+
But not able to split it within parenthesis or as end of line criteria.
Appreciate help
You may use this regex with \G
:
(?:\(|(?!^)\G/)([^/)]+)(?=[^()]*\))
\G
asserts position at the end of the previous match or the start of the string for the first match.