Title: Regular expression help needed
Last modified: August 18, 2016

---

# Regular expression help needed

 *  [varsity](https://wordpress.org/support/users/varsity/)
 * (@varsity)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/regular-expression-help-needed/)
 * 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!

The topic ‘Regular expression help needed’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [varsity](https://wordpress.org/support/users/varsity/)
 * Last activity: [19 years, 2 months ago](https://wordpress.org/support/topic/regular-expression-help-needed/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
