Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
((1?[0-9]{0,2}|(2[0-4][0-9])|(25[0-5]))\.){3}(1?[0-9]{0,2}|(2[0-4][0-9])|(25[0-5]))
/
gm

Description

java匹配ip, 看得懂的正则!

利用(1?[0-9]{0,2}|(2[0-4][0-9])|(25[0-5])) 匹配 0-255 0 0-9 0-9 1 0-9 0-9 2 0-4 0-9 5 0-5

Submitted by anonymous - 3 years ago