Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

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

Description

Matches port numbers (or simply numbers between 0 - 65535)

Submitted by anonymous - 8 years ago