Tip of the Day: Find non-ASCII Characters with Regex
![](/post/2020/04/tip-of-the-day-find-non-ascii-characters-with-regex/featured_hu5fbd845254b376776de4bebdf6c48abd_840931_d0726c143c30c59ac59d1b446fcfbf5f.webp)
Search for non-ascii characters using regex: [^\x00-\x7F]+
An example using Python:
import re
valid_ascii = "abcdef"
non_ascii = "ðñò"
re.search("[^\x00-\x7F]+", valid_ascii+non_ascii)
<re.Match object; span=(52, 55), match='ðñò'>