How do I remove all non-ASCII characters with regex and Notepad++?

Texh picture Texh · Jan 2, 2014 · Viewed 246.2k times · Source

I searched a lot, but nowhere is it written how to remove non-ASCII characters from Notepad++.

I need to know what command to write in find and replace (with picture it would be great).

  • If I want to make a white-list and bookmark all the ASCII words/lines so non-ASCII lines would be unmarked

  • If the file is quite large and can't select all the ASCII lines and just want to select the lines containing non-ASCII characters...

Answer

ProGM picture ProGM · Jan 2, 2014

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