[Tutor] Validating String contains IP address
Alex Kleider
akleider at sonic.net
Sat Apr 1 12:29:42 EDT 2017
On 2017-03-31 18:01, Mats Wichmann wrote:
> On 03/31/2017 06:44 PM, Alex Kleider wrote:
>> On 2017-03-31 16:35, Ed Manning wrote:
>>> What's the best way to validate a string contains a IP address
>>> Sent from my iPad
>>> _______________________________________________
>>> Tutor maillist - Tutor at python.org
>>> To unsubscribe or change subscription options:
>>> https://mail.python.org/mailman/listinfo/tutor
>>
>> The re module perhaps?
> This assumes "an IP address" is the four dotted numbers characteristic
> of IPv4. These days that's a bad assumption unless you're absolutely
> sure an IPv6 address can never appear. Can you?
Good point! I hadn't considered IPV6 and didn't know about the ipaddress
module.
Live and learn.
More information about the Tutor
mailing list