bug-bash
[Top][All Lists]
Advanced

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

Re: built-in regex matches wrong character


From: Chet Ramey
Subject: Re: built-in regex matches wrong character
Date: Thu, 6 Sep 2018 10:17:10 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 9/5/18 4:39 PM, Eric Blake wrote:

> Or, you can use bash's 'shopt -s globasciiranges' which is
> supposed to enable Rational Range Interpretation, where even in non-C
> locales, a character range bounded by two ASCII characters takes on the C
> locale definition of only the ASCII characters in that range, rather than
> the locale's definition of whatever other characters might also be
> equivalent (actually, while I know that shopt affects globbing, I don't
> know if it also affects regex matching - but if it doesn't, that's probably
> a bug that should be fixed).

Since bash uses the C library's regexp engine, and most C libraries don't
implement RRI, much less expose it as a flags option available via
regcomp(), there's no reason to expect that globasciiranges would have
any effect on regular expression matching.

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



reply via email to

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