I'm looking for a preg_replace regex that will match and remove
(123):
and
(+12):
I've tried a few including
$str = preg_replace('/([0-9]+)/s', '', $str);
but none I've tried have removed the ()
brackets/parentheses nor the +
sign
(yes I realise the +
in the regex means plus/continue not an actual +
sign) ;)
You need to escape the parenthesis and add the +
sign to your character group:
$str = preg_replace('/\([+0-9]+\)/s', '', $str);