apologies for the delayed response

it is supported in ast EREs
the ERE syntax clashes with ksh extended patterns where
        ?(foo)
means foo is optional
so you have to switch to ERE or perl RE in ksh:

        [[ aa == ~(E)(a)(?(1)a|b) ]]; echo $?
        [[ aa == ~(P)(a)(?(1)a|b) ]]; echo $?

On Thu, 7 Apr 2011 11:15:33 -0400 David Korn wrote:
> > Users, does the libast regex engine have conditional regex? The
> > Regular Expression Pocket reference lists this syntax but I can not
> > get it working in ksh:
> > (?(if)then|else)
> > 
> > Olga
> > 

> Not that I am aware.  ?(expr) means that expr is optional.

> Does ERE support this?  If so, what is the synax?

> If it is in ERE, then it should be possible to add to shell syntax since
> they both compile to the same thing.

> David Korn
> [email protected]
> _______________________________________________
> 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

Reply via email to