Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
^(?:(?:1?[1-9]?\d|[12][0-4]\d|25[0-5])(?:\.(?!$)|$)){4}$
"
gm

Description

RegexNumber
1?[1-9]?\d0-99, 110-199
[12][0-4]\d100-149, 200-249
25[0-5]250-255

Some wrong code : 1?\d?\d|2[0-4]\d|25[0-5] and \d{1,2}|1\d\d|2[0-4]\d|25[0-5] both includes 00-09

Submitted by MicroMicrocosm - 2 years ago