Please can someone help me out with the expression required for the following:
A $content variable holds a block of HTML and I want to match it against a string that could contain any ID. So I am looking for <p>###GALLERY(ANY NUMBER HERE)###</p>
This is the code I have already that doesn’t work (sorry new to regex):
if (preg_match("<p>###GALLERY[0-9]###</p>", $content))
{
// Found
}
Any help would be greatly appreciated.
You need to include delimiters in your expression:
I’m not sure if you need this, but adding a
+quantifier after[0-9]will allow for multi-digit numbers: