re question

David wizzardx at
Thu Sep 20 23:44:27 CEST 2007

On 9/19/07, Dan Bar Dov <bardov at> wrote:
> I'm trying to construct a regular expression to match valid IP address,
> without leading zeroes (i.e
>,, but not 324.1.1.1, nor
> This is what I come up with, and it does not work.
> r'(^[12]?\d{0,2}\.){3,3}[12]?\d{0,2}'
> What am I doing wrong?
> Any common knowledge IP matching RE? ?

More information about the Python-list mailing list