Yes, '?' is a special sign in regular expressions language that means, that preceding symbol can be in string, or can be omitted. You need to escape it by '\' to use as a string.
To replace many question marks by some string use the following regex:
'/\?{3,}/' => '???'
The expression in {} tells, that preceding symbol is repeated three or more times. We can write {,3} for example and it will mean, that something repeated up to three times. We can specify {3,6} and it will mean, that something is repeated from 3 to 6 times.
dot (".") means one any symbol.
plus ("+") means, that preceding symbol or expression is repeated one or more times. It is actually equal to {1,}.
asterisk ("*") means, that preceding symbol or expression is repeated zero or more times.
\d - means one any digit.
\s - means any space character
For example we can replace multiple spaces by one:
'/\s+/' => '' " - remember, + means "one or more"
If you need to apply + or * or any other "quantifier" to several characters you need to put these characters into brackets:
/(abc)+/ => "abc" - replace one or more abc sttrings by one copy so that "abcabcabc" becomes "abc"
So, about your case - yes, all correct, just escape ? by \
|