This expression will search for non-ASCII values:
[^\x00-\x7F]+
Tick off 'Search Mode = Regular expression', and click Find Next.
Source: Regex any ASCII character
Answer from ProGM on Stack OverflowThis expression will search for non-ASCII values:
[^\x00-\x7F]+
Tick off 'Search Mode = Regular expression', and click Find Next.
Source: Regex any ASCII character
Try "Find characters in range..."
In Notepad++, if you go to menu Search → Find characters in range → Non-ASCII Characters (128-255)...

...you can then step through the document to each non-ASCII character.
Be sure to tick off Wrap around if you want to loop in the document for all non-ASCII characters.

When you press Find it selects the character.
Then go to the Edit menu and pick Replace, and the "find" box will be filled with the current selection, which will be the character you found.
Then you can do the rest of the find/replace in the normal dialog.
How do I find and remove tab characters in Notepad++?
What is the fastest way to find special characters in Notepad++?
How do I make hidden characters visible in Notepad++ without searching?
I have a huge text file with with Extended ASCII characters like æàáàïû etc. How do I remove all these characters at a time from Notepad++ ?
All these characters are UTF8
- Ctrl+H
- Find what:
[\x{0080}-\x{0099}]or[\x00-\x09\x0B-\x0C\x0E-\x1F] - Replace with:
LEAVE EMPTYor whatever you want - CHECK Wrap around
- CHECK Regular expression
- Replace all
Explanation:
[ # character class
\x{0080} # from character http://www.fileformat.info/info/unicode/char/0080/index.htm
- # upto
\x{0099} # character http://www.fileformat.info/info/unicode/char/0099/index.htm
] # end character class
[ # character class
\x00-\x09 # hex 00 to 09
\x0B-\x0C # hex 0B to 0C
\x0E-\x1F # hex 0E to 1F
] # end character class
You can adapt the range to fit exactly your needs.
Screenshot (before):
I've taken some lines from your example file.

Screenshot (after):
Here I've used XXX as replacement to see where the replacement has been done.

It is possible that "Show All Characters" and/or "Show White Space and TAB" are enabled. Disable them by going to View -> Show Symbol, then selecting them.

You can use Find&Replace with RegEx mode. "FF" symbol is ASCII character 12 (you can see it in Notepad++'s ASCII table), so you can match it in a RegEx with \x0C (0C is 12 in hexadecimal).
To remove it, search "\x0C" and replace it with "" (nothing).
To replace it with a line break, replace it with "\r\n" on Windows ("\n" on Linux).
To add a line break in front on "ENGLISH", search "(ENGLISH)" and replace it with "\r\n\1". Note that this will add a line break in every occurence of the string "ENGLISH", even if part of a larger word: "MYENGLISHBOOK" will be split as "MY" and "ENGLISHBOOK".
To add a line break in front of the word "ENGLISH" (but not when it occurs inside a larger word), search "\b(ENGLISH)\b" (\b matches a word boundary) and replace it with "\r\n\1".
FF is a form feed character, to replace it with newline do following :
- Select the
FF, press Ctrl+H - Choose Extended Mode
- Replace with
\n - Click Replace All

What should be removed is not simply the ASCII escape character, but the entire escape sequence, which terminates the the "m".
In Notepad++, you can substitute regular expressions. Using an answer by @progm as a starting point, this expression will search for escape sequences for colors:
\x1b\[[0-9;]*m
Tick off Search Mode = Regular expression, and click Find Next.
Further reading:
- Notepad++, How to remove all non ascii characters with regex?
To delete the ASCII ESC character use:
tr -d '\033' <infile >outfile
[^\x00-\x7F] works fine, but, if you want to use a long character class like [^a-z0-9``~!@#$%^&*()-_=+[]{}\|;:'"<>,./?] you have to escape characters that have a special meaning (ie. -[]\ and add linebreak \r,\n.
Your regex becomes:
[^a-z0-9``~!@#$%^&*()\-_=+\[\]{}\\|;:'"<>,./?\r\n]
# ^ ^ ^ ^ ^^^^
- Ctrl+H
- Find what:
[^a-z0-9``~!@#$%^&*()\-_=+\[\]{}\\|;:'"<>,./?\r\n]+$But, again,[^\x00-\x7F]works fine and is more readable - Replace with:
LEAVE EMPTY - check Wrap around
- check Regular expression
- Replace all
Result for given example:
0123456789`~!@#$%^&*()-_=+[]{}\|;:'"<>,./?
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
If you are agnostic to the solution and not fixed to Notepad++ you could install bash for Win 10, as I showed here https://superuser.com/a/1252271/715210 (sorry I always come back to your questions with Linux workarounds ;) )
I would have a solution, where you unfortunately also will loose the apostrophe '
- open bash for Windows over start menu
- Go to the folder, where your file is located with
cd /mnt/c/path/folder(the drive C: is on /mnt/c) If your file is named foo.txt you could generate a file bar.txt with this command:
cat foo.txt | tr -cd '[:alnum:]\n\r~!@#$%^&*()-_=+{}\|;:<>,./?"`' | sed '/^$/d' > bar.txt
Explanation of the parts:
cat foo.txt outputs the text file and with the pipe | the output is redirected to the commande tr -cd which removes every char, which is not in the list after betwenn '...'. Followed by a pipe tosedto remove the empty lines. Last but not least with> bar.txt` we redirect the output to the file bar.txt
Thanks to:
- https://stackoverflow.com/a/20007549/7311363 for the :alnum: tip
- https://unix.stackexchange.com/a/48568/223965 for the apostrophe explanation