On 02/29/2012 09:02 PM, [email protected] wrote:
> Forum: CFEngine Help
> Subject: Re: Delete lines not matching list
> Author: neilhwatson
> Link to topic: https://cfengine.com/forum/read.php?3,25108,25109#msg-25109
>
> I don't think that '!' is a legal regex. There is the negative class e.g.
> [^0-9].
Thanks I looked up some other regex stuff and came up with (?! )
The different things I was trying ended up clearing out the entire file.
I wonder if this is related to list iteration.
So my list was 1 2 3 first iteration, delete every line not 1, second
iteration delete every line not 2, third iteration delete every line not 3.
So I pulled out the list and just tried with a static number.
delete_lines:
"(?!3.*).*"
Now it deletes all lines that dont start with 3 as I expect.
So is there no way to iterate over a list of things to not delete?
--
Nick Anderson <[email protected]>
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine