in reply to regexp problem using custom markup

What you're probably seeing is the greedy behavior of dot-star. .* will match as much as it possibly can, so in your example, it should match "blue] blue [/color] word. And a [color=red] red [/color", not "blue". You could change your regular expression to one of the following options:
# non-greedy dot-star @colors = $new =~ m/(\[color=.*?\])/gi; # say what you mean: match non-] characters @colors = $new =~ m/(\[color=[^\]]*\])/gi;

-- Mike

--
just,my${.02}