Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-06-03 12:53
Flavor·PCRE (Legacy)

/
^([1-9]\d{0,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[1-5])$
/
gm
Open regex in editor

Description

Validate a unsigned integer in the range 1-65535 This can for example be a UDP or TCP port number

Submitted by anonymous