[prev in list] [next in list] [prev in thread] [next in thread]
List: cfengine-help
Subject: Backreferencing with ReplaceAll
From: "Brian E. Seppanen" <seppy () chartermi ! net>
Date: 2003-04-21 13:08:27
[Download RAW message or body]
Hi Folks:
I've been trying to tackle an issue with a file that I have to keep in
sync between several boxes, which is different wherever it goes.
Basically I need to take a line
phone=555-1212
and transform it into
phone=9,555-1212
One way I'd like to do this is to match the regular expression, and use
parenthesis to capture the results of the actual phone number match and
then refer back to the results of the match after I do the replacement.
I believe this would be a convergent means of performing this match.
Basically I'm trying to use the \1 to recover the phone number that was
matched, it would appear that \1 may not be available for use, and I was
wondering if there is an alternative.
{ /etc/phonelist
ReplaceAll "phone=([0-9-]{2,})" With "phone=9,\1"
}
Any ideas would be greatly appreciated.
Thanks
Brian Seppanen
seppy@chartermi.net
906-228-4226 ext 23
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic