Am I having trouble with the correct regex string to remove a sequence from multiple? characters. I want to replace several consecutive? with one ?, but which characters run away ... eludes me.
Input Example:
Is it on ??? or what ???
Required Conclusion:
What is this thing for? or what?
I am using preg_replace () in PHP.
preg_replace('{\?+}', '?', 'Is this thing on??? or what???');
, "\? +" , , , "\? {2,}" ( .
preg_replace( '{\\?+}', '?', $text );
.
, .
, # verbatim strings .
( ):
preg_replace('/\?+/', '?', $subject);
preg_replace('/\?{2,}/','?',$text)
preg_replace('/(\?+)/m', '?', 'what is going in here????');
, m - .
-, http://regex.larsolavtorvik.com/
[?]+
??
?
str_replace('??', '?', 'Replace ??? in this text');