Regular Expressions 101

Community Patterns

Dotted Decimal IPv4 Adress (for programming languages)

2

Regular Expression
PCRE (PHP <7.3)

/
\b(?:(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]))\b
/
g

Description

Searches for dotted decimal IPv4 Adresses and saves the numbers in match groups.

Submitted by anonymous - 9 years ago