On Fri, December 6, 2013 1:23 pm, Marcio Humpris wrote:
> But how to make it catch just an email with ONLY 2 words in BODY? Not
> match empty message?

I strongly recommend http://www.regular-expressions.info to learn how
regexps work.  If you want to catch _exactly_ two words then you'd do
something like:

rawbody __RB_2_WDS /^(?:\s*\S+\s+\S+\s*$/

(In the original example, changing the {0,2} to {2} would match single
words too, since the whitespace is optional, but would not match an empty
message.)

Note that \S matches anything that isn't whitespace, which includes
punctuation.  If you only want alphabetic characters (no digits, no
punctuation, etc.) then replace \S with [A-Za-z-] or \w.

You'll learn a whole lot more if you follow the link in the first sentence.

                                                --- Amir


Reply via email to