bug-bash
[Top][All Lists]
Advanced

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

Re: Matching regular expression with Ctrl-A in the middle


From: Chet Ramey
Subject: Re: Matching regular expression with Ctrl-A in the middle
Date: Thu, 05 May 2011 16:48:19 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 5/5/11 8:26 AM, Greg Wooledge wrote:

> imadev:~$ bash-4.1.7     
> imadev:~$ re=$'o\001world$' string=$'hello\001world'; [[ $string =~ $re ]] && 
> echo match
> imadev:~$
> 
> It works fine with Ctrl-B for whatever reason:

That's because C-A is the internal `backslash' quoting character and needs
to be handled specially -- more specially than it was.

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



reply via email to

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