2016-03-19 21 views

答えて

2

あなたはsthを考え出すことができます。以下のような:

^(?:\b\w+[^\w\r\n]*){4,}$ 
#^ - anchor the expression to the beginning of a line 
# (?: - a non capturing group 
# \b - a word boundary 
# \w+ - match word characters greedily 
# [^\w\r\n] - do not match any of these character (classes) 
# the construct {4,} repeats this pattern 4 or more times 
# $ - match the end of the line 

あなたは上のmultilineモードを持っている必要があります。 a demo on regex101.comを参照してください。
@SebastianProskeが元の表現のエラーを発見してくれてありがとうございます。

+0

Gute Nacht - 4単語以上は5以上の繰り返しになります –

+0

ありがとう!素晴らしい:)これは、自動的にすべての不要な迷惑メールを整理することによって、時間の70%のように私を節約します! –

0
\n?^(\S+[^\S\n]+){3,}\S+.*$ 

これはTextWranglerで動作します。それはメモ帳で動作するかもしれない+ +。

関連する問題