in reply to (OT) Regular Expression

You could simply do:

$test = '#1 aba baba'; $test =~ s/#1/# 1/g; print "$test\n";