How to find words of a specific character length in notepad++
notepad
I am looking to find words of 14 or more characters in Notepad++. Any ideas?
Best Answer
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.
Edit:sorry, I missed the without resorting to Regular Expressions.
Sadly, you'll need to use a RegEx to do this as far as I know.
I've setup the RegEx below for you.
Under find in files use Alpha.*Bravo in the Find what select Regular expression and .matches newline.
Select the Directory to search in and you should find your files.
If you need them in other order as well, you can do the same inverting the words: Bravo.*Alpha
If there is different case possibilities you'll need to show that IE [aA]lpha.*[bB]ravo
To get the prefixes (the text before the dashes), press Ctrl+H and fill out the fields as follows:
To get the suffixes (the text after the dashes), press Ctrl+H and fill out the fields as follows:
This breaks if there are any dashes in either the prefix or the suffix.
If you need to get both separately, just capture the results from the first replace to a different file (or the clipboard), then press Ctrl+z and perform the second replace.
If you need to include the dash and/or spaces, you can add them as needed in the "Replace with :" text box before or after the replacement placeholder.
Best Answer
Unfortunately notepad++ doesn't do regex multipliers so you have to do a regex search (Search -> Find -> Search Mode = 'Regular Expression') for:
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.