I have brackets that contain data like this:
[vc_tag][/vc_tag]
If the tag can contain any of about 30 pieces of text.
I need some regex that will remove any brackets containing vc_
I have this, but it removes everything, not just vc_:
$data = preg_replace('/\\[(?>[^\\]]*)\\]/', '', $content);
I also tried:
$data = preg_replace('/\\[(vc_[^\\]]*)\\]/', '', $content);
which removes opening [vc_tag]but not closing[/vc_tag]
It is written in PHP, by the way.
source
share