ใน Python มี special sequence \w สำหรับจับคู่ alphanumeric และ underscore (เมื่อไม่ระบุ LOCALE และ UNICODE flags)
ตัวอย่าง
import re
result = re.search(r'^\w+$', 'Tutorials123')
print(result.group())
ผลลัพธ์
Tutorials123
ใน Python มี special sequence \w สำหรับจับคู่ alphanumeric และ underscore (เมื่อไม่ระบุ LOCALE และ UNICODE flags)
import re
result = re.search(r'^\w+$', 'Tutorials123')
print(result.group())
Tutorials123