I’m trying to explode a string like this:
([a:b:c:d:...])
I have a code that partially works
([^\(\[\]\):])+
but it’s not ideal since I need to make sure the string found is within the ([ ]) tags. But whenever I add them to the regexp, it stops working (can’t find any matches).
\(\[([^\(\[\]\):])+\]\)
What am I doing wrong?
I’m using this website to test them regular expressions
http://myregextester.com/index.php
Thank you in advance.
I would do it in two parts, first match the stuff between the brackets
which will put the inner contents in to
matches[1], then simply explode/split on: