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 »

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: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: regex problem

Post by Stealth »

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 »

!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: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: regex problem

Post by Stealth »

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 »

Many thanks !
Post Reply