I have a string in which I want to replace the text [[signature]] with a given value, but because it is encoded, the text looks like %5B%5Bsignature%5D%5D.
How do I replace this using a regular expression? This snippet works, but only if the string is not encoded:
$replace = preg_replace('/\[\[signature\]\]/', 'replaced!', $html);
str_replace('%5B%5Bsignature%5D%5D', 'replaced!', $html)urldecodemethod available in Php before using your regex.