You could adapt the code in this node, pushing captures onto an array rather than concatenating them onto a scalar string. It uses regular expression recursion so there are actually two patterns involved rather than one "fixed" regex but the actual match is done just the once without a g flag. Obviously, the global match already shown is a much simpler solution.
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^3: Variable matching on a regex
by johngg
in thread Variable matching on a regex
by LaintalAy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |