On Mon, 2017-10-02 at 23:18 +0200, Benny Pedersen wrote:
> John Hardin skrev den 2017-10-02 23:13:
> 
> > Where?  \w is not case-sensitive.
> 
> perfect then, i had not know that, learning still so
>
Do you have a copy of the 'Camel Book'? AKA "Programming Perl" by Larry
Wall, Tom Christiansen & Jon Orwant, pub O'Reilly.

If you don't have it, you need a copy. Its never failed to explain
anything I've needed to know about Perl and its chapter on regexes will
help you to solve all regex-based SA rule problems. 

Or there's an online reference: http://www.regular-expressions.info/

Also worth knowing:
 
- if you're running Linux, you can use the grep command to test
  regexes. Use the -P or --perl-regexp option to make grep use Perl
  regexes, so it is possible to quickly test regexes you want to use
  in SA rules by running the spam, saved as a file, through the
 
     grep -P 'regex' <spam

  command as a really fast check on whether the regex is any good
  before you add a rule using it to a .cf file. I use this quite a
  lot.

- if you don't like bash command lines or use some other OS, you can
  do the same with the online regex tester at https://regex101.com/ 
  by typing in your regex and then pasting the relevant part of the
  spam message you're testing against into its 'Test String' box.

Martin

Reply via email to