Regular Expressions 101

Community Patterns

1...456

IP address without local

1

Regular Expression
.NET 7.0 (C#)

@"
(?<=(?!(https*://)*((127)|(192\.168)|(0\.0\.0\.0)))(?:(?:https*://)|^))(?:(?:2[0-5][0-5]|1[0-9]{2}|[0-9]{1,2})\.(?:2[0-5][0-5]|1[0-9]{2}|[0-9]{1,2})\.(?:2[0-5][0-5]|1[0-9]{2}|[0-9]{1,2})\.(?:2[0-5][0-5]|1[0-9]{2}|[0-9]{1,2}))(?=[^\d\s]|$)
"
gm

Description

Matches IP addresses excluding local addresses

Submitted by pvl_zh - a month ago