Regular Expressions 101

Community Library

Community Library Entry

1

Regular ExpressionOpen Workspace

"
^((?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?:\.(?!\:)|)){4})\:(?!0)(\d{1,4}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$
"
g

Description
Created·2022-01-12 07:59
Type·Match
Flavor·Java

This regex matches a IPv4 with a TCP Port (1-65535) Example: 192.168.0.69:1337 will match and have the groups:

  • Group 1: 192.168.0.69
  • Group 2: 1337
Submitted by SIMULATAN
Open Workspace