Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remov all words that are longer than two characers

I want to remove all words in nodepad++ that are longer than 2 chars. I know how to find two letter words:

^[a-zA-Z]{2}$

However, I want to remove all words that are larger. Any recommendations how to do that?

BR!

UPDATE

This is how my data look like: enter image description here

UPDATE

Some sample data from the file:

 AF | AX                         AL                          
DZ                          
 AS                          
AD                          
ANGOLA                          AO   
like image 646
Carol.Kar Avatar asked Dec 04 '25 13:12

Carol.Kar


2 Answers

Well, instead of specifying 2 as the size, you say "3 or more"; 3,.

[a-zA-Z]{3,}

like image 60
L3viathan Avatar answered Dec 07 '25 08:12

L3viathan


You could use

[^\s]{3,}

This will match any non-space character string that is at least 3 letters long with no maximum

like image 42
flec Avatar answered Dec 07 '25 08:12

flec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!