Regex select lines that contain more n occurence of a character -
data:
hello 1 2 3 4 5 6 7 hello 1 2 3 4 5 6 7 8 hello 1 2 3 4 5 hello 1 2 3 4 5
i know [ ]{n,}
works preceding characters only.
you use like:
(?: [^ ]*){n}
would match space
followed 0 or more non-space
characters n times. don't need check more n, because if contains n+1 spaces must contain n.
if want count whitespace characters you'd need:
(?:\s\s*){n}
Comments
Post a Comment