[Exim] regex problem (PCRE)

Pàgina inicial
Delete this message
Reply to this message
Autor: Bernard Stern
Data:  
A: exim-users
Assumpte: [Exim] regex problem (PCRE)
Hello,

I'm playing a bit with backward assertions in regexes using pcretest,
and have the following problem.
I need to match 'any line ending in '"' but not in '\"'.
So my regex looks like:

/(?<!\\)"$/

then:

re> /(?<!\\)"$/
data> fdsafsdfdfda"

0: "

which is ok, but

data> dfasdfdaf\"

0: "

which should not be ok. Now testing with another character:

/(?<!a)"$/

it works as expected:

re> /(?<!a)"$/
data> fadsfdaafda"

No match
data>

I know there are some pretty good regex gurus on this list, maybe
they can help here. Thanks in advance!

Bernard Stern, SWITCH

____________S_W_I_T_CH___Swiss Academic_______________________________________
        mail: SWITCH Head Office       a          Tel: +41 1 268 1520
              Limmatquai 138           n          Fax: +41 1 268 1568
              CH-8001 Zurich           d        e-mail: stern@???
________________________________________Reseach Network_______________________