[英]Using Regex in Notepad++, how do I select only the period inside some specific lines but not inside others
在Notepad ++中使用Regex,如何仅选择以下行中的句点:
<div class="english">One. Two. Three. Four. Five.</div>
但不把这些时期放在其中:
<div class="spanish">Uno. Dos. Tres. Cuatro. Cinco.</div>
谢谢
如果只想选择<div class="english">
和</div>
之间的点,则可以使用:
(?:<div class="english">|(?!^)\G)(?:[^.<]|<(?!/div>))*\K\.
说明和演示 :
(?: # non-capturing group
<div class="english"> # our delimiter
| # or
(?!^)\G # the end of the last match
)
(?:
[^.<] # any character except '.' or '<' (even newline)...
| # or ...
<(?!/div>) # '<' not followed by a '/div>'
)*
\K # leave what we found so far out of the match
\. # match the dot
<div class="(?!english)[^"]*">.*?<\/div>\K|\.(?=.*?<\/div>)
您可以使用\\K
执行此操作\\K
参见演示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.