Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Counting characters in a line in notepad++

I'm trying to count the amount of times a character in a single line appears to then edit the lines which it does.

Say i have a line that goes:

\serv\file\subfile\subsubfile\subsubsubfile

Is there any way I can count the amount of times the \ character appears, and if it doesn't appear more than say twice, clear the line and leave it blank?

like image 883
KjetilJar Avatar asked Mar 20 '23 10:03

KjetilJar


1 Answers

find ^([^\\]*[\\]?[^\\]*){0,2}$

replace with empty string

like image 167
Kent Avatar answered Apr 01 '23 17:04

Kent