craftbeerpi4-pione/sample.py

14 lines
154 B
Python
Raw Normal View History

2019-01-14 07:33:59 +01:00
import re
pattern = "(actor)\/([\d])\/(on|toggle|off)$"
p = re.compile(pattern)
result = p.match("actor/1/toggle")
print(result, result.group(3))