Hi dude, Try the following -
need to buy (a\s)?products?([\s?]{0,})? added a conditional a with a space "(a\s)?" added a conditional s after product s? added a conditional combination of space and question marks ([\s?]{0,})? Hope it helps Rgds Tony > Subject: Re: Regex in case of spaces > To: users@spamassassin.apache.org > From: h.rei...@thelounge.net > Date: Fri, 8 Apr 2016 14:37:58 +0200 > > > > Am 08.04.2016 um 14:02 schrieb Robert Boyl: > > Hi, everyone! > > > > Sorry, lame with regex. > > > > How can I make a rule to catch: > > > > Need to buy a product ? > > > > And also catch "need to buy a product ?" > > > > Note the extra spacing. > > > > Tried this, didnt work: > > > > describe TEST123 test > > body TEST123 /\bNeed to buy products *\?\b/i > > score TEST123 0.0 > > > > If possible, also make it catch if more than 1 question mark :) > > /.*need to buy products.*\?.*/i > > .* = any chars independent how often > so it's basically "anything which contains the text followed by a ? >