irc.blah

These are old archives. They are kept for historic purposes only.
Post Reply
Oyarsa
Posts: 54
Joined: Wed Feb 14, 2007 12:35 pm
Location: irc.otherworlders.org
Contact:

irc.blah

Post by Oyarsa »

Ok just getting into the spamfilters.

These are very cool I must say :-)

Anyway ... there is an example in the docs of:

/spamfilter add pc block - - come to irc\..+\..+


which is great but it also blocks my own irc net's name that way. How would I have it block all others save for my own?
JanisB
Posts: 128
Joined: Fri Apr 22, 2005 9:05 am
Location: LV
Contact:

Post by JanisB »

Code: Select all

<?php
$r = '/come to irc\.(?!blah\.).+/';
echo preg_match($r, 'come to irc.blah.net').'<br>';
echo preg_match($r, 'come to irc.net').'<br>';
echo preg_match($r, 'come to irc.le-blah.net');
?>
will output

Code: Select all

0
1
1
Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason »

JanisB: UnrealIRCd uses the TRE, not PCRE, regular expressions engine.
Why the hell can't my signature be empty?
"Your message contains too few characters."
JanisB
Posts: 128
Joined: Fri Apr 22, 2005 9:05 am
Location: LV
Contact:

Post by JanisB »

According to homepage and syntax reference i found, that TRE knows, what (?!blah\.) is and how to match .+, so I think my example will work on Unreal. Sure, without beginning-end slashes :)
Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason »

.+ and \., etc, are standard for all POSIX compliant regexes (and you're not really a regex if you don't understand them)

You're incorrect about the (?!blah\.) portion, however. It is in his todo list, not his features list.
Why the hell can't my signature be empty?
"Your message contains too few characters."
JanisB
Posts: 128
Joined: Fri Apr 22, 2005 9:05 am
Location: LV
Contact:

Post by JanisB »

http://laurikari.net/tre/ wrote:These are other features I'm planning to implement real soon now:
(?!pattern) Zero-width negative look-ahead assertions.
Oops, really... Sorry :<
Post Reply