ใช้ regex . (dot) เป็น wildcard จับคู่ตัวอักษรใดก็ตามยกเว้น newline
ตัวอย่าง
import re
rex = re.compile('th.s')
l = "this, thus, just, then"
print(rex.findall(l))
ผลลัพธ์
['this', 'thus']
ใช้ regex . (dot) เป็น wildcard จับคู่ตัวอักษรใดก็ตามยกเว้น newline
import re
rex = re.compile('th.s')
l = "this, thus, just, then"
print(rex.findall(l))
['this', 'thus']