zjfz-2019-s402281/regexp/Task303.py
2020-01-12 13:28:13 +01:00

7 lines
163 B
Python

import re
def divisable_by_four(string):
pattern = '^[048]$|^[0-9]*([13579][26]|[2468][048])$|^[1-9][0-9]*(00|04|08)$'
return re.search(pattern, string)