Re: [exim] regex questions

Top Pagina
Delete this message
Reply to this message
Auteur: Andrew
Datum:  
Aan: Tony Finch
CC: 'exim-users@exim.org'
Onderwerp: Re: [exim] regex questions
Hello Again -

Thanks very much !

regex = (?i)<script>

Works very well ( I was trying /(?i)<script>/ before :( .... Time for
me to go and do lots of regex learning ;) ).


Thank you to all of those that helped (and everyone else who works on
the exim project).

Cheers,
(A very happy) Andrew.


Tony Finch wrote:

>On Mon, 13 Dec 2004, Andrew wrote:
>
>
>
>>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???).
>>
>>
>
>You are right. < introduces the list separator character, so your working
>regex becomes /cr[Ii]pt>/ (using / to quote, perlishly). The failing regex
>becomes a list of regexes, most of which are syntax errors /Ss]cr/ or
>/Ii]/ or /Pp]/ or /Tt]>/.
>
>You can avoid the < problem by starting the list of regexes with <: to
>explicitly set the list separator character to : which is the same as
>the default.
>
>Or you can make your regex more readable by setting case-insensitive mode
>as in (?i)<script> which also avoids the list separator problem.
>
>Tony.
>
>