Difficult-Rocket/tests/_test_re.py

6 lines
110 B
Python
Raw Normal View History

2021-02-03 22:04:34 +08:00
import re
ipv4 = re.compile('[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}')
print(re.match(ipv4, '1.2.3.2'))