echo \"tests\"|perl -pe \"s/s[t$]//g\" Unmatched [ in regex; marked by <-- HERE in m/s[ <-- HERE 5.020000/ at -e line 1, <> line 1.
Can\'t
Alternatively, use sed with your expression as is:
sed
echo "tests"| sed "s/s[t$]//g"