<p>I'm having trouble coming up with the correct regex string to remove a sequence of multiple ? characters. I want to replace more than one sequential ? with a single ?, but which characters to escape...is escaping me.</p>

<p>Example input:</p>

<blockquote>
  <p>Is this thing on??? or what???</p>
</blockquote>

<p>Desired output:</p>

<blockquote>
  <p>Is this thing on? or what?</p>
</blockquote>

<p>I'm using <a href="http://php.net/preg_replace" rel="nofollow noreferrer">preg_replace()</a> in PHP.</p>

```
```
preg_replace('{\?+}', '?', 'Is this thing on??? or what???');
```
```
That is, you only have to escape the question mark, the plus in "\?+" means that we're replacing every instance with one or more characters, though I suspect "\?{2,}" might be even better and more efficient (replacing every instance with two or more question mark characters.