[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 <mark@iu.hio.no> (2003-03-31 11:40:17 BST):
>> On 31 Mar, Akop Pogosian wrote:
>> > On Fri, Mar 28, 2003 at 11:05:34PM +0100, Mark.Burgess@iu.hio.no 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: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- HashCommentLinesMatching, Akop Pogosian, 2003/03/27
- Re: HashCommentLinesMatching, Billy Allan, 2003/03/28
- Re: HashCommentLinesMatching, Andrew Stribblehill, 2003/03/28
- Re: HashCommentLinesMatching, Billy Allan, 2003/03/28
- Re: HashCommentLinesMatching, Mark . Burgess, 2003/03/28
- Re: HashCommentLinesMatching, Akop Pogosian, 2003/03/31
- Re: HashCommentLinesMatching, Mark Burgess, 2003/03/31
- Re: HashCommentLinesMatching, Andrew Stribblehill, 2003/03/31
- Re: HashCommentLinesMatching,
Mark . Burgess <=
- Re: HashCommentLinesMatching, clemens fischer, 2003/03/31
- Re: HashCommentLinesMatching, Mark . Burgess, 2003/03/31
- Re: HashCommentLinesMatching, clemens fischer, 2003/03/31
- Re: HashCommentLinesMatching, Akop Pogosian, 2003/03/31