We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcbec33 commit 208ff34Copy full SHA for 208ff34
src/basic/string.py
@@ -38,6 +38,7 @@ def extract_alphanumeric(s: str) -> str:
38
>>> extract_alphanumeric("こんにちは123ABCワールド")
39
'123ABC'
40
"""
41
+ # isalnum() alone would include Unicode alphanumeric characters (like '12345' or 'ABCDE')
42
# isascii() ensures we only get ASCII characters (0-127),
43
# excluding Unicode characters like Japanese, Emoji, etc.
44
return "".join(c for c in s if c.isascii() and c.isalnum())
0 commit comments