Can somebody explain the following regexp to me?
/\bCreditor[A-Za-z]*?\b(?=([^"]*"[^"]*")*[^"]*$)/i
I am trying to debug somebody else's code (a non-supported Glossory Tooltip plugin):
$glossary_title = "Creditor";
$glossary_search = '/\b'.$glossary_title.'[A-Za-z]*?\b(?=([^"]*"[^"]*")*[^"]*$)/i';
$glossary_replace = '<a....>$0</a>';
$content_temp = preg_replace($glossary_search, $glossary_replace, $content);
The problem I am having with the above is it will also match and wrap in <a></a> tags around Creditors, Creditor's where it should only match and wrap <a></a> tags around (case incentive) Creditor creditor etc (strictly).
I'm also not sure if the above regex will work with words ($glossary_title) with spaces in them, and apostraphies ' which it ideally should.
Any help would be greatly appreciated. Thanks
ps. Sorry about the dupe thread, not sure why that happened.
Newbie regex help
Moderator: General Moderators