[issue7132] Regexp: capturing groups in repetitions

Philippe Verdy report at bugs.python.org
Thu Oct 15 00:33:57 CEST 2009


Philippe Verdy <verdy_p at wanadoo.fr> added the comment:

In addition, your suggested regexp for IPv4:

'^(\d{1,3})(?:\.(\d{1,3})){3}$'

is completely WRONG ! It will match INVALID IPv4 address formats like 
"000.000.000.000". Reread the RFCs... because "000.000.000.000" is 
CERTAINLY NOT an IPv4 address (if it is found in an URL) but a domain name 
that must be resolved into an IP address using domain name resolution 
requests.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7132>
_______________________________________


More information about the Python-bugs-list mailing list