On 1/17/14 8:01 AM, Greg Wooledge wrote:
> On Thu, Jan 16, 2014 at 03:46:38PM -0800, Eduardo A. Bustamante López wrote:
>> [[ $'\a' =~ $'\a' ]] -> 0
>> [[ $'\a' =~ $'\\\a' ]] -> 0
>> [[ $'\a' =~ $'\\[\a]' ]] -> 1
>> ---
>> [[ $'\177' =~ $'\177' ]] -> 0
>> [[ $'\177' =~ $'\\\177' ]] -> 1
>> [[ $'\177' =~ $'\\[\177]' ]] -> 1
>
>> Notice that only $'\177' seems to fail in the middle case, while the
>> others work just fine.
>
> Maybe I'm missing something, but why do you consider that to be wrong?
> I would expect [[ x =~ yx ]] to fail (return 1) every time.
There is a question about the correct behavior when y == '\', since the
backslash is special to pattern matching. When matching a pattern or a
regexp, do you think x =~ \x should succeed, because the backslash acts
as an escape?
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/