On 7/10/18 8:52 AM, Ilkka Virta wrote:
> On 10.7. 15:27, Greg Wooledge wrote:
>> On Mon, Jul 09, 2018 at 10:46:13PM -0300, marcelpa...@gmail.com wrote:
>>> Word boundary anchors \< and \> are not parsed correctly on the right
>>> side of a =~ regex match expression.
>>
>> Bash uses ERE (Extended Regular Expressions) here.  There is no \< or \>
>> in an ERE.
> 
> Or does it use the system's regex library, whatever that supports?

It uses the POSIX regular expression API (regcomp/regexp/regerror/regfree)
if the system's libc supports it. Since it uses the POSIX interfaces, it
assumes nothing beyond the POSIX definition of EREs.

> If '\<' matches just a regular less-than sign (but has a useless
> backslash), then surely that should not match?

A system's libc can provide extensions. Bash can't assume anything about
them. That's why this matches on Linux, but not Mac OS X.

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

Reply via email to