[Top][All Lists]

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

Re: parenthesised regular expressions and non-greedy operator ? - non st

From: Chet Ramey
Subject: Re: parenthesised regular expressions and non-greedy operator ? - non standard bash behaviour
Date: Mon, 4 Dec 2017 16:49:27 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 12/4/17 1:42 PM, H.-Dirk Schmitt wrote:
> From the 2 replies I unterstand that the implementation in bash is
> correct due to the „official“ standard.
> For myself I have solved the issue in my script - but the regular
> expression I developed for my problem are without the 'non-greedy'
> operator more difficult to read and maintain. From that point of view
> it would be an improvement for bash to implement the non-greedy
> operator.

The thing is, bash doesn't "implement" its regular expressions, per se.
Bash uses the Posix standard library functions (regcomp/regexec) if they
are available in the C library when it's configured and built.  I'm not
wild about adding a dependency on pcre, or a configure test for it, just
to have two varieties of regular expressions available.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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