Tim Waugh wrote:
> Further to this, I am having trouble porting existing scripts to
> bash-3.2's new style of regex matching.
> 
> Here is one example that is problematic: I want to use a character class
> in my regex, but bash seems to get confused by the ':]]' closing the
> class, and apparently takes it as a ']]' closing the conditional
> expression.
> 
> Here is a distilled test case:
> 
> [[ $line =~ [[:space:]]*(a)?b ]] && echo match || echo no match
> 
> I used single quotes around the RHS in bash-3.1, which worked very well.
> How should this be written so as to work with bash-3.2 -- and, of
> course, still with bash-3.1?

It cannot; the level of backwards compatibility is not that great.  I will
have to think about a solution.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to