First off, @colors will receive values that are kept by parentheses, and you don't have any in your regex.
And second, the .* in your regex will make it match "[color=blue] blue [/color] word. And a [color=red] red [/color]" all at once because regexes are greedy -- they match as much as possible. By adding the ? behind .* it matches as little as possible.
elusion : http://matt.diephouse.com
In reply to Re: Regexp
by elusion
in thread regexp problem using custom markup
by kidd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |