regex problem

These are old archives. They are kept for historic purposes only.
Post Reply
one4two
Posts: 9
Joined: Fri Sep 18, 2009 9:15 am

regex problem

Post by one4two » Mon Feb 21, 2011 4:06 pm

Hi everyone :)

Im not sure why the following doesnt work

I want to care for eg: ( its always like !cmd_text (_ = space)

!send .cant.this starting with . should be blocked, but doesnt work
!send cant.this. ends with . works - is blocked

Here's my regex:

Code: Select all

spamfilter { regex "^!(sup|send)(.*)(^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$)";
Can someone tell what im doing wrong ?

Stealth
Head of Support
Posts: 2083
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: regex problem

Post by Stealth » Thu Feb 24, 2011 6:53 am

Give examples of exactly what you want blocked (at least 5 please) so we know exactly what you need.

one4two
Posts: 9
Joined: Fri Sep 18, 2009 9:15 am

Re: regex problem

Post by one4two » Fri Feb 25, 2011 11:40 am

!send .cant.this
!send cant.this.
!send this.is.another.test+
!send (should.not.work
!send why.is.it.cold$
!send was.it.that.late!

If the part after !send - seperated with a space - starts or ends with an non alphanumeric char, it should be blocked.

Stealth
Head of Support
Posts: 2083
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: regex problem

Post by Stealth » Sat Feb 26, 2011 6:57 am

This is the best I could come up with:

Code: Select all

^!send (\W.+|.+\W)$

one4two
Posts: 9
Joined: Fri Sep 18, 2009 9:15 am

Re: regex problem

Post by one4two » Sat Feb 26, 2011 9:54 am

Many thanks !

Post Reply