$_ = "t?e\\\\xt\\\\* with escapes\\*\n"; s/\\\\/\\s/g, s/(?## t#e\xt\? with escapes* #### $_ = "t?e\\\\xt\\\\* with escapes\\*\n"; s/\\\\/\\s/g, s/\\\?/\\S/g, s/\\\*/\\T/g, s/\?/#/g, s/\*/?/g, s/\\(\W)/$1/g, s/\\S/?/g, s/\\T/\*/g, s/\\s/\\/g; print;