2012/2/24 ольга крыжановская <[email protected]>
> 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
#
>
> Olga
> --
> , _ _ ,
> { \/`o;====- Olga Kryzhanovska -====;o`\/ }
> .----'-/`-/ [email protected] \-`\-'----.
> `'-..-| / http://twitter.com/fleyta \ |-..-'`
> /\/\ Solaris/BSD//C/C++ programmer /\/\
> `--` `--`
> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users
>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users