I\'m looking to try and combine 2 regex expressions.
$test = preg_replace(\'/\\[.*?\\]/\', \'\', $test);
I use this to remove any square bra
Simplest answer is to use an or:
'/\[[^\]]*\]|[\[\]=]+/'
Notice that I also changed the inner pattern in the first string. I'm not sure if the backslash is needed there.