clean up a string (123..9)

Status
Not open for further replies.

louie

New Member
I have a search string that will have at the end a special format included between ( brackets).
eg. string here (123)

I am looking for a way to clean the ( and ) plus the numbers included in the brackets.
I think preg_replace() is best for this but I am lost at regular expressions.

anybody has any ideas?
 

louie

New Member
found the solution:

PHP:
$sq = @$_REQUEST['sq'];
$bbcode = '/(\()+([0-9])+(\))/';//(123)
$sq = preg_replace($bbcode, "", $sq);
 
Status
Not open for further replies.
Top