Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-05-06 16:02
Flavor·ECMAScript (JavaScript)

/
^((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]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))$
/
gm
Open regex in editor

Description

Validates the subnet. Not the subnet mask. It is only for 2 or 3 octets

Submitted by anonymous