[英]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.