I want to parse this
(adv) much (thanks)
I want to eliminate the words and the bracket (adv) but not (thanks)
the condition is: inside bracket, and word length inside bracket is 1-5 characters
I am using preg_match in PHP
Thank You
I want to parse this
(adv) much (thanks)
I want to eliminate the words and the bracket (adv) but not (thanks)
the condition is: inside bracket, and word length inside bracket is 1-5 characters
I am using preg_match in PHP
Thank You
$matches = NULL;
preg_match("/\([^\)]{1,5}\)/", "(adv) much (thanks)", $matches);
var_export($matches);
array (
0 => '(adv)',
)
$str = '(adv) much (thanks)';
$str = preg_replace('/\(\w{1,5}\) ?/', '', $str);