Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-06-07 16:51
Flavor·PCRE (Legacy)

/
(?:^|\s) (\b(?:2[0-4]\d|25[0-5]|1?\d?\d)\b \. \b(?:2[0-4]\d|25[0-5]|1?\d?\d)\b \. \b(?:2[0-4]\d|25[0-5]|1?\d?\d)\b \. \b(?:2[0-4]\d|25[0-5]|1?\d?\d)\b) (?:$|\s)
/
gmx
Open regex in editor

Description

Matches ranges from 0-255 for all four octets. Extra leading or trailing '.' invalidate the match, as do values > 255.

Submitted by OnlineCop