I'm trying to match the sub-string CONTENT=%0
using regular expressions. I have been trying for quite some time and nothing seems to work! Any ideas?
This one worked for me: /CONTENT=%0/
You don't need to use regex for this simple kind of task, but... you can if you want to... use regex pattern
CONTENT=%0
$pattern = '/CONTENT=%0/';
$s = preg_replace($pattern, $replacement, $s);
See this demo.