ใช้ regex ได้จำนวน captured groups ในสตริงที่กำหนด
ตัวอย่าง
import re
m = re.match(r"(\d)(\d)(\d)", "632")
print(len(m.groups()))
ผลลัพธ์
3
ใช้ regex ได้จำนวน captured groups ในสตริงที่กำหนด
import re
m = re.match(r"(\d)(\d)(\d)", "632")
print(len(m.groups()))
3