Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
\b(?<!\.)(?:(?:25[0-5]|2[0-4][\d]|1?[\d][\d]?)\.){3}(?:25[0-5]|2[0-4][\d]|1?[\d][\d]?[\d]?(?!\.))\b
/
gm

Description

This expression grabs any IPV4 address from any text, any time, anywhere. Hopefully.

Submitted by Ricardo Chica - 3 years ago (Last modified 3 years ago)