• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

quick help on "Regular expressions"

zimu

Diamond Member
hey guys!

trying to set up a mail filter and want to use regular expressions... i know they can be really advanced!

basically, i've been getting bombarded with junk mail which all have the exact same subject header:

Re: ab c news

where a, b and c are random characters- can include numbers, capital letters etc. but the spacing between characters is IDENTICAL.

i want to basically discard all messages that have the format above... anyone have any clue?

cheers 🙂
 
That one is pretty easy.

The regular expression

'/Subject: Re: ?? ? news/'

should catch anything with that subject line.
 
Originally posted by: MathMan
That one is pretty easy.

The regular expression

'/Subject: Re: ?? ? news/'

should catch anything with that subject line.

Not exactly. You need to specify the character(s) to use the ? on.

This is what you want:

/Re: [^ ]{2} [^ ] news/

It says, "match a string that contains the chars 'Re:' followed by a space, followed by two non-space characters, followed by a space, followed by a non-space character, followed by a space, and finally followed by the string 'news'.
 
Originally posted by: binister
Originally posted by: MathMan
That one is pretty easy.

The regular expression

'/Subject: Re: ?? ? news/'

should catch anything with that subject line.

Not exactly. You need to specify the character(s) to use the ? on.

This is what you want:

/Re: [^ ]{2} [^ ] news/

It says, "match a string that contains the chars 'Re:' followed by a space, followed by two non-space characters, followed by a space, followed by a non-space character, followed by a space, and finally followed by the string 'news'.


you rock 🙂
that worked!

Save message to: /dev/null 0660
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.
 
Back
Top