Regular Expressions 101

Community Patterns

Basic IP matching

1

Regular Expression
ECMAScript (JavaScript)

/
\d+\.\d+\.\d+\.\d+
/
mg

Description

I've looked at some of the other IP matching that seems a lot more complex but several of them don't work, and I'm too simple minded to figure out why. Keep it simple, I've never had a problem matching IP addresses in logs with this one.

Submitted by anonymous - 9 years ago