Page 1 of 1

Detect value of 0 or 1

Posted: Sat Feb 02, 2008 2:49 am
by JAB Creations
In AWStats you can set custom detection rules. One such rule I'm interested but needs regex modification is the HTTP query 'connection;' on my site (which has a value or 0 or 1). By default using this PERL regex it only detects if the value is '1'...

Code: Select all

ExtraSectionFirstColumnValues2="QUERY_STRING,connection=([^&]+)"
How do I include all numbers including '0'?

Re: Detect value of 0 or 1

Posted: Sat Feb 02, 2008 1:03 pm
by Christopher
That would be [^0-9]

Re: Detect value of 0 or 1

Posted: Sat Feb 09, 2008 4:15 pm
by GeertDD
arborint wrote:That would be [^0-9]
I'd invert that regex part. You do want to match the 0 or 1 while [^0-9] mathes anything that is *not* a digit.

So, make it [0-9] or \d or even [01].

Re: Detect value of 0 or 1

Posted: Sat Feb 09, 2008 4:23 pm
by JAB Creations
Actually the issue was in AWStats as it was intentionally stripping zeros to avoid loops which I haven't encountered since commenting the line out. Thanks for replying!