Skip to content

Instantly share code, notes, and snippets.

@toruta39
Created January 31, 2014 01:54
Show Gist options
  • Save toruta39/8725270 to your computer and use it in GitHub Desktop.
Save toruta39/8725270 to your computer and use it in GitHub Desktop.
Match irregular characters (such as greek, asian characters)
str = "ありがとう"
result = re.search(r"[^\x00-\x7F]", str)
if result:
print(result.start()) # 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment