How can I find words of a specific character length in notepad++?

6

1

I am looking to find words of 14 or more characters in Notepad++. Any ideas?

Will

Posted 2012-07-20T18:14:16.997

Reputation: 61

Answers

6

Unfortunately notepad++ doesn't do regex multipliers so you have to do a regex search (Search -> Find -> Search Mode = 'Regular Expression') for:

\w\w\w\w\w\w\w\w\w\w\w\w\w\w+

Each '\w' is a word character (not spaces or punctuation ect.) and the last '\w+' means that it should find one or more of them so the expression mean 14 or more word characters.

Godwin

Posted 2012-07-20T18:14:16.997

Reputation: 161

This works, but newer version of Notepad++ support multipliers. @Will: The word character (\w) also matches digits (0-9) and underscores (_). This might or might not be what you want. – Dennis – 2012-07-20T21:34:52.173

1Cool, looks like I was testing it on an earlier version. Then \w{14,} should work or [A-z]{14,} if you want to only include alphabetic letters. – Godwin – 2012-07-22T03:04:28.060

1Yes, \w{14,} will work as expected. However, be aware that [A-z] is not the same as [A-Za-z], since it includes the following characters: [\]^_`​ – Dennis – 2012-07-22T03:12:36.913

3

If you use Notepad++ 6, you can take advantage of the new regex engine that supports PCRE (source).

Press Ctrl + F and perform the following search:

Find:        [A-Za-z]{14,}
Search mode: Regular Expression

[A-Za-z] means every uppercase or lower case letter. {14,} means 14 times or more.

Note that [A-Za-z] won't work reliably for texts in some languages. To include all letter characters from the Windows-1252 character encoding, use [A-Za-zƒŠŒŽšœžŸªµºÀ-ÖØ-öø-ÿ] instead.

For more information on regular expressions, consult regular-expressions.info.

Dennis

Posted 2012-07-20T18:14:16.997

Reputation: 42 934

-1

hi this is my first answer here :D if you consider your word composed of anything except space or new line, comma, dot or quote then use this regex

Press Ctrl + F and perform the following search:

Find: [^[:blank:]^\n.,']{14,} Search mode: Regular Expression

hope it works for u .

med ism

Posted 2012-07-20T18:14:16.997

Reputation: 1

the one who put -1 , can you elaborate why ? maybe we could learn more from your knowledge hhh – med ism – 2018-09-20T15:12:59.623