Helpful Information
 
 
Category: Regex Programming
PHP, Regex and multiple html edits

What i am trying to do is to edit multiple html pages with a php script. However what i do not know is how to implement Regex to do what i need.

i have a javascript code that replaced a tag="such and such" to onclick="tag'such and such';" however find and replace only replaced the first part leaving the following:

onclick="tag'such and such"

i need to parse the DOM and add '; before the "

onclick="tag'(.*?)" search finds even those that do not require changes due to the generality of the (.*?) command.

how can i find all the ones that do not have '; and replace with preg_replace .


Assistance highly appreciated

Welcome to Dev Shed.

Thread moved from PHP to the "new" Regex ...

Would be better to fix your expression instead of trying to throw another one at it.

What expression/code do you have?










privacy (GDPR)