Home » Validate an IP address using ReGex

Validate an IP address using ReGex

Spring Framework Basics Video Course

In this example we will use regular expressions in python to check for a valid IP address

This example will check IPv4 and IPv6 address formats

Table of Contents

Code

When you run this you should see something like this

>>> %Run regexip.py
This is a valid IPv4
This is a valid IPv4
This is a valid IPv6
This is an invalid IP

Link

 

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More