You are right to suspect that your regex is greedy: /<blah>(.*)<\/blah>/ matches the entire string, capturing:
red</blah><blah>white</blah><blah>blue
Read perlre for more about greedy regexes, but suffice it to say, I think you want /<blah>(.*?)<\/blah>/
In reply to Re: non-greedy incremental regular expression?
by eibwen
in thread non-greedy incremental regular expression?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |