while (/\{(.*?)\}/g) { $tag = $1; print "The tag is $tag\n"; }