> -----Original Message-----
> Michael Hutchinson wrote:
> > > body NICE_GIRL_01 /Hello! I am (?:bored|tired) (?:today|this
> > > (?:afternoon|evening)|tonight)\./

> >
> > Forgive my ignorance, but what does the question mark and colon do

at
> > the start of the brackets? I have (bored|tired) in my own rules, so

how
> > does (?:bored|tired) affect the outcome?

>=20
> Using (?: avoids creating backreferences. It should be slightly
> faster if the backreference is not used.
>=20
> (?:bored|tired)
>=20
> Is the same as:
>=20
> (bored|tired)
>=20
> But without creating \1 or $1 reference to it.
>=20
> SpamAssassin is written in Perl and uses PCRE (Perl Compatible Regular
> Expressions). Those are not quite the same as standard Extended
> Regular Expressions. For a full description see the 'perlre' man

page.
>=20
> man perlre
>=20
> "(?attern)"
> "(?imsx-imsxattern)"
> This is for clustering, not capturing; it groups
> subexpressions like "()", but doesn't make
> backreferences as "()" does. So
>=20
> @fields =3D split(/\b(?:a|b|c)\b/)
>=20
> is like
>=20
> @fields =3D split(/\b(a|b|c)\b/)
>=20
> but doesn't spit out extra fields. It's also cheaper
> not to capture characters if you don't need to.
>=20
> Any letters between "?" and ":" act as flags
> modifiers as with "(?imsx-imsx)". For example,
>=20
> /(?s-i:more.*than).*million/i
>=20
> is equivalent to the more verbose
>=20
> /(??s-i)more.*than).*million/i
>=20


Yay, less overhead... .=20

Thanks for the pointers Bob, you've been a big help

Cheers,
Michael Hutchinson