$text =~ s/#([^#]+)#/$hash{$1}/g [download]
In reply to Re: regex substitution by rchiav in thread regex substitution by michellem