.+? is a non-greedy match-anything. $+ is last captured group.while ($str =~ m/{(.+?)}|([\w:]+)/g) { print $+; }
In reply to Re: Splitting string using two overlapping patterns
by oiskuu
in thread Splitting string using two overlapping patterns
by kpr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |