Subject: Re: [ast-users] Expression to match against '$ ' or '# ' ?
--------


> What is the correct ~(Elr) expression to match variable "foo" against
> either '$ ' or '# ' ?
> I tried [[ "$foo" == ~(Elr)(\$|#)\  ]] but somehow this doesn' work...
> 
> 

This  seems to match against '# ' but not '$ '.

Since $ is special in RE's, and since the $\ will be stripped by ksh,
I would expect that you would need to use
                ~(Elr)(\\\\$|#)\ 
or
                ~(Elr)('\$'|#)\ 
as the pattern.  However, this is not working and it looks like a bug.

David Korn
[EMAIL PROTECTED]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to