I have been stuck with a regex and I tried everything I could think about to solve it, in vain. I have a text with different kinds of "tags" inside, for example : [[Category:Animals]].The word after "Category:" can be different (like "Category:School") and that's why I want to match "[[Category: ... ]]" to remove that tag from the text. When I try my code on phpliveregex.com, it works, but once uploaded on the server, it doesn't work.
$text = '[[Category:Animals]]';
$pattern = '/\[\[Category:(.*?)\]\]/';
$intro = preg_replace($pattern, "", $text, $count);
When I display the result of $count to check the match, the result is NULL. I have tried different regex and still no match...
Thank you for your help !