Title: complex regex find/replace
Last modified: June 25, 2020

---

# complex regex find/replace

 *  Resolved [dleigh](https://wordpress.org/support/users/dleigh/)
 * (@dleigh)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/complex-regex-find-replace/)
 * Hi, I’ve been wrestling with a regex find/replace issue and I’m not having any
   success. I’ve tested my regex at: [https://www.functions-online.com/preg_replace.html](https://www.functions-online.com/preg_replace.html)
   and [https://www.phpliveregex.com/#tab-preg-replace](https://www.phpliveregex.com/#tab-preg-replace)
   and it works fine in both places.
 * Here is my shortcode:
 *     ```
       [remote_content url="http://wolc.com/what-we-do/the-journey-for-adults/worship/christian-disciplines/prayer-for-the-week/" method="GET" timeout="10″ htmlentities="false" strip_tags="false" decode_atts="false" selector="#content" remove="#breadcrumbs" find="~<p><strong>Church\ Online\ Prayer\ Requests</strong></p>.*~sim" replace="</section>" cache="true" cache_ttl="3600″]
       ```
   
 * I get the section with the id “#content” just fine but the regex to get rid of
   the second half of the section is not working. I get the whole section back as
   if the regex was ignored.
 * Any thoughts of other places I could test to work this out? Thanks for this great
   plugin!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcomplex-regex-find-replace%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [dleigh](https://wordpress.org/support/users/dleigh/)
 * (@dleigh)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/complex-regex-find-replace/#post-13124548)
 * Well, now it’s working. Must have been some sort of cache issue. Thanks!
 *  Thread Starter [dleigh](https://wordpress.org/support/users/dleigh/)
 * (@dleigh)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/complex-regex-find-replace/#post-13124551)
 * Closing it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘complex regex find/replace’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/remote-content-shortcode.svg)
 * [Remote Content Shortcode](https://wordpress.org/plugins/remote-content-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/remote-content-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/remote-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/remote-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/remote-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/remote-content-shortcode/reviews/)

## Tags

 * [regex](https://wordpress.org/support/topic-tag/regex/)

 * 2 replies
 * 1 participant
 * Last reply from: [dleigh](https://wordpress.org/support/users/dleigh/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/complex-regex-find-replace/#post-13124551)
 * Status: resolved