help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HashCommentLinesMatching


From: Mark . Burgess
Subject: Re: HashCommentLinesMatching
Date: Mon, 31 Mar 2003 17:05:02 +0200 (MEST)


On 31 Mar, Andrew Stribblehill wrote:
> Quoting Mark Burgess <address@hidden> (2003-03-31 11:40:17 BST):
>> On 31 Mar, Akop Pogosian wrote:
>> > On Fri, Mar 28, 2003 at 11:05:34PM +0100, address@hidden wrote:
>> >> 
>> >> Can't you just negate the regular expression?
>> > 
>> > Oh, there is a way to do that? How?
>> 
>> See POSIX regular expressions. The ^ symbol negates...but it depends
>> on what you're after. See documentation, or
>> 
>> http://www.iu.hio.no/~mark/unix/unix.html#SEC29
> 
> Yeah, that negates character classes. Does the regex library we use
> support negative look-{ahead,behind} assertions a-la Perl?:
> 
> (?<=foo)d # Matches 'd' provided it's preceeded by 'foo'
> (?<!foo)d # Any d without 'foo' immediately before it
> rhu(?=baa) # Matches 'rhu' if it has 'baa' after it
> rhu(?!baa) # rhu without 'baa' after it
> 
> The two negative ones here would do the job nicely.
> 
> For that matter, if Cfengine doesn't do this, would there be a
> problem with switching to libpcre (Perl-compatible regular expression
> library)? I know POSIX is a standard but Perl is more well-known and
> is basically just a superset of POSIX extended regular
> expressions[0].
> 
> Footnote:
>   0: Proof by assertion!
> 


I don't know whether perl regexes are posix standard or not,
but I would be more inclined to stick to a posix compliant
lib than anything else,

M

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






reply via email to

[Prev in Thread] Current Thread [Next in Thread]