[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: backrefs in regexps?
From: |
Tim Nelson |
Subject: |
Re: backrefs in regexps? |
Date: |
Fri, 22 Oct 2004 15:32:40 +1000 (EST) |
On Fri, 22 Oct 2004, martin f krafft wrote:
In this e-mail, you may find that it works if you use \1 instead
of $1. If not, you'll need to do some more reading.
It does not. It seems that cfengine is not capable of back
referencing in the replacement text. Neither \1, $1, ${1}, $(1), or &
work.
Ouch. My apologies.
This is sad.
I agree. However, one of the beauties of cfengine is that the
code is pretty readable. I suspect that by looking at the GlobalReplace
function in item-ext.c, and the "regexec" man page, you'll be able to
figure out how to fix the problem (GlobalReplace is called from
edittools.c).
:)
--
Tim Nelson
Server Administrator
WebAlive Technologies Global
Level 1 Innovation Building, Digital Harbour
1010 LaTrobe Street
Docklands, Melbourne,
Vic, 3008
Phone: +61 3 9934 0812
Fax: +61 3 9934 0899
E-mail: tim.nelson@webalive.biz
http://www.webalive.biz/