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
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
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
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
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
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 tha
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 mysel
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 rege
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 cl
I am trying to delete all lines in a file that are not elements of my
list. I have a standalone test posted here
https://gist.github.com/1946826
The test populates /tmp/testfile with 3 lines
1
2
3
If you add a line that isnt one of those I want it to be deleted. It
seems that I am not doing my d
10 matches
Mail list logo