Select entire line if it has more than x ":" in it.

Find, replace, find in files, replace in files, regular expressions

Select entire line if it has more than x ":" in it.

Postby c4p0ne » Sun Dec 07, 2008 6:35 am

Scan and select entire lines that have more then 4 occurrences of the colon ":" character in them.
User avatar
c4p0ne
Newbie
 
Posts: 9
Joined: Sat Oct 04, 2008 1:21 pm
Location: Classified

Re: Select entire line if it has more than x ":" in it.

Postby pietzcker » Sun Dec 07, 2008 8:39 am

Perl regex:

^(?:[^:\r\n]*:){5}.*\r\n
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm

Re: Select entire line if it has more than x ":" in it.

Postby c4p0ne » Sun Dec 07, 2008 8:58 am

fantastic. :mrgreen:
User avatar
c4p0ne
Newbie
 
Posts: 9
Joined: Sat Oct 04, 2008 1:21 pm
Location: Classified


Return to Find/Replace/Regular Expressions