I want to remove or mask password from some confidential files. I am using following syntax and it works with simple password like alphabets and numbers base password but doesn’t working with special character password like !@#$%^ . Does anyone know how to match special character in regex. Here what i am using for simple password.
sed -i 's/password="[0-9A-Za-z]\+"/password="XXXXXXXX"/g' server.xml
Use this regexp instead. Are they allowed to have ” in the password? Then you might need some more modifications.