Hi,
I'm trying to spamfilter privmsg's that contain DCC SEND/RESUME/CHAT, but where the DCC is not preceded by this special \x01 character.
I hade the following regex: [^\x01]+DCC (SEND|CHAT|RESUME)
And this seemed to match: DCC SEND versions.txt 1359719488 1024 17115
Now, I wonder why. Since clearly, this DCC SEND is NOT preceded by one or more characters that do NOT equal \x01?
Any thoughts/suggestions would be appreciated.
Weird match
Weird match
All spelling mistakes, grammatical errors and stupid comments are intentional.
Re: Weird match
Your regex matches where 1 or more characters preceding "DCC" are NOT \x01, what you wanted was where there are NO characters before DCC, like this:
^DCC (SEND|CHAT|RESUME)
The ^ means that DCC must be the FIRST thing in the message with NOTHING before it.
^DCC (SEND|CHAT|RESUME)
The ^ means that DCC must be the FIRST thing in the message with NOTHING before it.
Your IP:
Your Country:
Your Country:
Re: Weird match
Hey,
I know that is what I should be using when I wanted no characters before it and understand what ^ is, but imagine I want to catch this string mid-sentence, when there are other characters before it, that do not match \x01.
The point is that I believe in this example, that regex should not match, and it does. I'm wondering why.
I know that is what I should be using when I wanted no characters before it and understand what ^ is, but imagine I want to catch this string mid-sentence, when there are other characters before it, that do not match \x01.
The point is that I believe in this example, that regex should not match, and it does. I'm wondering why.
All spelling mistakes, grammatical errors and stupid comments are intentional.
Re: Weird match
It could probably be that the regex system used doesnt support \x<hex>
Your IP:
Your Country:
Your Country:
Re: Weird match
Kinda weird then that the default spamfilter.conf containts \x01?
All spelling mistakes, grammatical errors and stupid comments are intentional.
Re: Weird match
True, unless it just doesn't support them in [] character classes.
Your IP:
Your Country:
Your Country: