开发者

Need to filter IPs in Google Analytics

I need to filter, 213.190.149.120 - 213.190.149.1开发者_运维知识库27 inclusive

Anyone know if there is a regular expression I can use to do this?

Thanks, C


If you need a strict regular expression, don't forget that . matches any character, so

^213.190.149.(1(2[0-7]))$

will match "213d190c149a125" for example, which is not what you want.

On top of what, you're capturing each of the 3 digits, which is resource consuming for no apparent reason. A simple yet stricter regex would be closer to what @Marc suggested:

^213\.190\.149\.12[0-7]$


Don't know how Google Analytics expects the expression but this would be a valid regualar expression for your request:

213.190.149.12[0-7]


Okay.Found this link...

and it outputs...

^213\.190\.149\.(1(2[0-7]))$

Very handy for anyone else looking to do this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜