Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^192\.168\.((([1-2]00)|([1-2]0[1-3]))\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4])))$
"
gmi

Description

Using two similar sets of /22 IP ranges (192.168.100.1/22 & 192.168.200.1/22); Select all IP's, ignoring only the Network & Broadcast IP's.

Submitted by Jason - 6 years ago