Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

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

Description

Matches localhost ip range with optional port capture: 127.X.X.X or 127.X.X.X:PORT

ToDo: check valid ip address.

Submitted by Rodrigo M. A. - 9 years ago