Regular Expressions 101

Community Patterns

IpAddress

2

Regular Expression
Python

r"
^(?:2[0-4][0-9]|25[0-5]|1?[0-9]?[0-9])[.](?:2[0-4][0-9]|25[0-5]|1?[0-9]?[0-9])[.](?:2[0-4][0-9]|25[0-5]|1?[0-9]?[0-9])[.](?:2[0-4][0-9]|25[0-5]|1?[0-9]?[0-9])$
"
gm

Description

Ensure the ip address format is correct

Submitted by aaa - 3 years ago