Re: CFEngine Help: Re: Delete lines not matching list

2012-03-01 Thread Nick Anderson
On 03/01/2012 02:14 PM, no-re...@cfengine.com wrote: > Forum: CFEngine Help > Subject: Re: Delete lines not matching list > Author: bahamat > Link to topic: https://cfengine.com/forum/read.php?3,25108,25135#msg-25135 > > You can use pcretest(1) (usually included with libpcre, or pcre packages) to

CFEngine Help: Re: Delete lines not matching list

2012-03-01 Thread no-reply
Forum: CFEngine Help Subject: Re: Delete lines not matching list Author: bahamat Link to topic: https://cfengine.com/forum/read.php?3,25108,25135#msg-25135 You can use pcretest(1) (usually included with libpcre, or pcre packages) to test your regular expression with various input. Example: $ p

CFEngine Help: Re: Delete lines not matching list

2012-03-01 Thread no-reply
Forum: CFEngine Help Subject: Re: Delete lines not matching list Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,25108,25122#msg-25122 Test this very carefully. You could have some unexpected results. ___ Help-cfengine mailing

Re: CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread Nick Anderson
On 02/29/2012 10:08 PM, Nick Anderson wrote: > Getting closer > > vars: > "regex" string => join("|", "list"); > > delete_lines: > "^(?!($(regex)).*).*$" > > this almost works like I want it, it makes this regex > ^(?!(1|2|3).*).*$ I dont know what I was thinking, this d

Re: CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread Nick Anderson
Getting closer vars: "regex" string => join("|", "list"); delete_lines: "^(?!($(regex)).*).*$" this almost works like I want it, it makes this regex ^(?!(1|2|3).*).*$ I want it to delete any line not starting with my list elements but this one doesn't do what I thought i

Re: CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread Nick Anderson
On 02/29/2012 09:44 PM, no-re...@cfengine.com wrote: > Forum: CFEngine Help > Subject: Re: Delete lines not matching list > Author: neilhwatson > Link to topic: https://cfengine.com/forum/read.php?3,25108,25112#msg-25112 > > !? is negative lookahead. It is more complicated that you think. List >

CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread no-reply
Forum: CFEngine Help Subject: Re: Delete lines not matching list Author: neilhwatson Link to topic: https://cfengine.com/forum/read.php?3,25108,25112#msg-25112 !? is negative lookahead. It is more complicated that you think. List iteration in edit_line bundles works. I'd done it myself. I can'

Re: CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread Nick Anderson
On 02/29/2012 09:02 PM, no-re...@cfengine.com 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

CFEngine Help: Re: Delete lines not matching list

2012-02-29 Thread no-reply
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]. ___ Hel