I'm new to regular expressions and I checked the following pattern using RegExr, but it fails in PHP with preg_replace.
I've tried adding an extra backslash to escape the first \ with no luck.
Any help pointing me in the right direction would be greatly appreciated.
Example:
$output = preg_replace("\[if](.*)[/if/]*", ' ', $output);
I've also tried adding slashes:
$output = preg_replace("/\[if](.*)[/if/]*/", ' ', $output);
The string I'm trying to modify is:
[if] <p>A statement goes here</p> [/if]
error_reporting(~0)?