Re: [exim] regex questions

Góra strony
Delete this message
Reply to this message
Autor: Andrew
Data:  
Dla: Peter Bowyer, exim-users
CC: 
Temat: Re: [exim] regex questions
Peter Bowyer wrote:

>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...
>
>
>

Sorry - me being blonde when typing the message (I had it correct in my
config) - :(

>>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
>
>

(yep, already tested this, and it works!)

>3. I just tried this:
>
>/(?i)<script>/
>
>Which seems to do the job.
>
>
>

It works for me in pcretest too - did you try it in the exim config? (I
don't expect you to, but I am curious if it worked in pcretest, or exim
config with exiscan).

Many thanks for the reply!

Cheers,
Andrew.


>Peter
>
>
>
>