PDA

View Full Version : Regex question



hofmax
04-14-2007, 05:30 AM
So I recently tried to exclude my own IP from AWStats with SkipHosts="" but I realised that my ISP seems to have a huge IP range.

I already have to work with the second octet. Also I realised that my assigned IP moves between a range in the second octet.

Sometimes I will be on 216.46.xxx.xxx and at other time on 216.55.xxx.xxx

So what would be the regex to exclude the range from 216.45 (letīs be generous) to 216.55 ?

dophinsluv
04-15-2007, 04:21 AM
Try 216\.[4-5][0-9]

This website gives a good breakdown on regex

http://www.regular-expressions.info/reference.html

hofmax
04-15-2007, 07:36 AM
Ah, yeah I came across that one before - that site is really good! Thanks.

By the way for my awstats.conf I used REGEX[216\.[4-5][0-9]]

dophinsluv
04-15-2007, 09:17 AM
If you want to be greedier try this

216\.[46|55]

The | lets you add individual numbers. 46 or 55 or... if you want more just add more |'s.

hofmax
04-15-2007, 09:54 AM
Thanks, Iīll try and see if the range is doing itīs job. Now I chmod -ed the file correctly so it wonīt get overridden anymore - I should read my own blog posts more often :D