$ and ? also need to be properly backslashed due to the double quoting

On single quoting only the ?
This is because the following chars are special in
regex: .*?|
php: $
SDE uses "/[\.\*$?\"\/\|\\:<>]/" which makes / also a special char
Another way is bash: "#[\.\*$?\"/\|\\:<>]#"
preg_match("/[\.\*\$\?\"\/\|\\:<>]/"
preg_match('/[\.\*$\?"\/\|\\:<>]/'
preg_match('#[\.\*$\?"/\|\\:<>]#"
As you can see there are several solutions to a single problem, so use the one you like most.