sub My_Regex { my($raw_text, $tag) = @_; $raw_text =~ /<$tag>{1}(.*)(<\/$tag>){1}/; $output = $1; print "OUTPUT: $output\n"; }