简体   繁体   English

正则表达式在没有其他文本的情况下查找引号内的所有 p 标签

[英]Regex find all p tags inside quotes without other text

I'm trying to edit a poorly translated book.我正在尝试编辑一本翻译得很差的书。

I have text with lots of unnecessary p tags in it. 我的文本中有很多不必要的 p 标签。 I want to find all p tags inside quotes as in this piece: “…Hmm. </p>Is… That, really so…?” 我想找到引号内的所有 p 标记,如本文所示: “…Hmm. </p>Is… That, really so…?” “…Hmm. </p>Is… That, really so…?” and to remove those p tags. 并删除那些 p 标签。

I managed to come up with a regex to find such sentences ( \“.*</p>.*\” ), but I can't imagine one to select only </p> inside quotes without other text so that I can just replace them all in a single click. 我设法想出了一个正则表达式来找到这样的句子( \“.*</p>.*\” ),但我无法想象一个 select 只有</p>在没有其他文本的引号内,这样我就可以只需单击一下即可将它们全部替换。

Send help please. 请发送帮助。

edit1: changed all words "brackets" to "quotes". edit1:将所有单词“括号”更改为“引号”。

(?<=\“(.|\n)*)(<\/p>)(?=(.|\n)*\”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM