Subject: Re: Re: [ast-users] ~(E)[\]] does not match "]"?
--------
>> David, the extended regular expression ~(E)[\]] does not match the
>> string "]", i.e. ksh -c 'x="]" ; [[ $x == ~(E)[\]] ]] && print match'.
>> Is this a mistake on my side or a bug in libast regex?
>
>
> I think that's a quoting problem. To match a literal ] in brackets, ] must
> be the first char in [] and it does not need to be escaped. But without the
> \ ksh will report syntax error. If we put the RE in a var then it'll work
> fine:
>
> # re='~(E)[]]'
> # [[ ']' == $re ]] && print match
> match
> #
The ksh parser currently doesn't handle
[[ $x == ~(E)[]] ]]
which is a parser bug. This will be fixed in a future release.
David Korn
[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users