This only matches twice because each match continues were the previous left off. The first match consumes two a's, so you can only match once more.
Many solutions are possible, but without a better idea of your requirements, most of the propositions won't fit. Do you intend to match fixed strings or are you planning to use true patterns? What does your data look like? What kinds of overlap between matches are possible? There is no universally applicable answer to your problem.
Makeshifts last the longest.
In reply to Re: multiple matches with regexp
by Aristotle
in thread multiple matches with regexp
by almaric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |