我希望删除任何正文段落中有花括号的内容。
例如,从这篇文章中:
<p>While orthotic inserts are able to provide great support and pain relief, they aren’t quite as good as a specialty shoe. Remember that an ill-fitting insert can cause permanent damage and talk to a podiatrist about your foot pain for the best recommendation. Click here if you want to learn more about pain in the foot arch unrelated to plantar fasciitis.</p> <h2>Related Posts</h2> <h2>So What Are These Socks Really Good For?</h2> <h2>Are the bottom of your feet causing you problems?</h2> <h2>A PF Relief Guide</h2> <h2>What is Foot Reflexology & What is it Good For?</h2> <h2>Leave a Reply Cancel reply</h2> <p>Your email address will not be published. Required fields are marked *</p> <p>Name</p> <p>Email</p> <p>Website</p> <p>five − = 2 .hide-if-no-js { display: none !important; } </p><h2>Food For Thought January 2016</h2> <h2>Show Us Some Social Love!!</h2> <h2>Recent Posts</h2> <li> The Climate Pledge of Resistance</li> <li> Green Activism in Boulder, Colorado</li> <li> The Truth About Money and Happiness</li> <li> Why Is There So Much Skepticism About Climate Change?</li> <li> Which Device Would Work Best For You?</li>
我想删除这部分内容:
<p>five − = 2 .hide-if-no-js { display: none !important; } </p>
使用以下正则表达式:
<p>.*?\{.*?\}.*?</p>
,会将整篇文章都移除,而不是只移除包含花括号的段落,这是一个奇怪的问题...请问我在正则表达式代码上有什么问题吗? 谢谢!
<p>
标签,然后检查每一个标签是否存在大括号。 - Tim Biegeleisen<\/p>
,因为它可能会被解释为分隔符。 - Michael