Regular Expressions 101

Community Library Entry

-1

Regular Expression
Python

r"
^127\.\d{1,3}\.\d{1,3}\.\d{1,3}(\:\d+)?$
"
mg

Description

Matches all ips that points to localhost like, optionally capturing port number: 127.X.X.X and 127.X.X.X:<port>

Submitted by Rodrigo M. A. - 9 years ago