Regular Expressions 101

IP address

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
(?(DEFINE)(?'n'25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))(?P>n)\.(?P>n)\.(?P>n)\.(?P>n)
/
gm

Description

Matches and verifies IP address. 192.168.0.1 Matches 999.999.9.9 Didn't match

Submitted by Anonymous