I've been struggling for two days to get this to work, but I just can't (I'm terrible at regular expressions :S).
${test}[arg]
From this text, I need to retrieve two different things: test
and arg
. To do it, I have created this regex:
(\$\{(\b[a-zA-Z0-9.]+\b)\})(\[(.+)\])?
With that example, it works. However, if I try this other text: ${test}[arg1] - ${test2}[arg2]
, I just get one match with 2 groups: test
and arg1] - ${test2}[arg2
, instead of getting 2 different matches: one with groups test
and arg1
, and the other with groups test2
and arg2
.
I hope you can help me out.
Thanks in advance.