1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Rep Power

    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
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Atlanta, GA
    Rep Power
    Welcome to Dev Shed.

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

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    Would be better to fix your expression instead of trying to throw another one at it.

    What expression/code do you have?

IMN logo majestic logo threadwatch logo seochat tools logo