WordPress.org

Forums

Regular expression help needed (1 post)

  1. Varsity
    Member
    Posted 8 years ago #

    Before I upgrade my site to WP2.1, I need to replace some markup. It's a good job I tested the new version out on a local server or I'd be screwed right now!

    I need to replace this pattern:

    <div class="figure"><a href=""><img src="" alt="" /></a>
    Text</div>

    With this pattern:

    <p class="figure"><a href=""><img src="" alt="" /></a>
    Text</p>

    Replacing the opener is easy, but I'm going to need a regular expression to catch the closing tag too. And I know next to nothing about them!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.