[Top][All Lists]

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

Re: built-in regex matches wrong character

From: Aharon Robbins
Subject: Re: built-in regex matches wrong character
Date: Thu, 6 Sep 2018 17:39:37 -0000 (UTC)

In article <address@hidden>,
Eric Blake  <address@hidden> wrote:
>But bash could be taught to convert any regex that contains a range with 
>both endpoints ASCII into a different bracket expression before handing 
>things over to regcomp().  That is, if the user is matching against 
>[a-d], bash hands [abcd] to regcomp() instead.  You don't need a flag in 
>regcomp() to get RRI, just merely some pre-processing (and often memory 
>allocation, as the expansion of a range into a non-range tends to 
>require more characters).

This is easy and inexpensive for ASCII only.  Full RRI does the
same thing for wide character sets as well, though, and there
the possibility for using very large amounts of memory makes the
rewrite-the-range idea less palatable.
Aharon (Arnold) Robbins                 arnold AT skeeve DOT com

reply via email to

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