[exim] Is there a regex escape function?

トップ ページ
このメッセージを削除
このメッセージに返信
著者: John Horne
日付:  
To: Exim users
題目: [exim] Is there a regex escape function?
Hello,

I am trying to do a 'match' of one variable against another:

${if match {$h_X-UoP-Loop:} {^$sender_address } }

The first variable is a space separated list of addresses, but in this
instance we are checking if the list begins with the sender address and
then a space.

However, the sender address may well contain '.', which as a regex will
match any character. So my question is whether there is any function to
escape characters such as '.' so that they can then be used correctly in
a regex?

There is an 'escape' function in Exim, but that relates to non-printing
characters. I could use the 'sg' function to translate '.' to '\.', but
I was just wondering if there was an easier way?




Thanks,

John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001