Re: [exim] regex questions

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Peter Bowyer
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] regex questions
Andrew <andrew@???> wrote:
>
> I want to do a regex search for <script> : <iframe> - etc, etc in the
> message body. However these are poor regex's to use. ( eg <SCRIPT>
> would get through) -
>
> using the command line tool grep - the expression
> <[Ss][Rr][Ii][Pp][Tt]>


That has a typo, you missed out the C. But assuming that's a red herring...

> matches <script>, <Script>, etc, etc...
>
> However when I drop this into exim - it doesn't match! :(
>
> regex = <script>           works  (but doesn't match other cases) -

>
> regex = <scr[Ii]pt>          Works -

>
> However
> regex = <[Ss]cr[Ii][Pp][Tt]> fails :(
>
> (I think the combination of the leading < and [] is breaking it....
> but I don't know why - any advice???).


1. Use the pcretest tool which you'll find in the build-xxx directory in
your Exim build.

2. Read the PCRE docs which you'll find in the doc directory in your Exim
build

3. I just tried this:

/(?i)<script>/

Which seems to do the job.

Peter