date: 2007-05-07 14:58:07+00:00

Regex to match a valid IP address

categories: - Linux

Match an IPv4 address..

b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) .(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)b

Test your regex rules online at http://www.regextester.com/

IPv6 rule soon ;)