2017-09-17 43 views
0

我在記事本++中有超過200行,我想標記所有包含兩倍字符「。」,點的行。刪除所有包含兩次字符的行

例如:

test.com 
test.co.uk [MARK] 
test.net 

感謝。

+0

Notepad ++支持正則表達式,所以這應該很簡單。 –

回答

0

這做工作:

  • 查找內容:^(?:[^.\r\n]*\.){2,}.*$

說明:

^    : beginning of line 
    (?:   : start non capture group 
    [^.\r\n]* : 0 or more any character that is not a dot or a linebreak 
    \.   : a dot 
){2,}   : end group, must appear at least twice 
    .*   : 0 or more any character 
$    : end of line 
+0

如果該行是最後一行並且沒有換行符,則不會找到匹配項。 – Pharaoh

+0

@Pharaoh:確實如此。 – Toto

1

您可以使用此正則表達式模式:^.*\..*\..*$

Find the line that contains dot character 2 times

+0

這可以工作,但要確保複選框爲'。匹配換行符「未被選中 – Pharaoh

相關問題