Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def ipv4_address(ip):
- return (bool(re.match(
- '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]).){3}
- ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$', ip))
- if True else False)
- print(ipv4_address("127.0.0.1n"))
- A(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}Z
Add Comment
Please, Sign In to add comment