$test=q|\AFZ\BJK \*\AFZ...*\ |; $new.=$1 while $test=~/([^\\]|\\\*.*?\*\\)/g;