re Challenge: More Compact?

Tim Daneliuk tundra at
Sun Jul 15 21:00:02 CEST 2001

The following re is (I think) the description of a legitimate IP addess in
"quad" format (IPV4).  My question is, can it be made even shorter?

ipquad   = r"^((\d\d?\d?\.){3}(\d\d?\d?))$"
Tim Daneliuk
tundra at

More information about the Python-list mailing list