$str =~ s/in/=~/; $str =~ s/(?:\s)(\([^\)]*\))/my $s=$1;$s=~s!\D!!g;" m#[$s]#"/e;