In J602 windows front-end, it can high-light the unbalanced
parenthesis, the example was taken from config/colorsmp.ijs
using the JSample scheme.

I think it should be efficient and not coded in J.
An implementation in c/c# with regex would be appreciated.

Вс, 25 дек 2016, Raul Miller написал(а):
> Formally speaking, no, not using pure regular expressions by themselves.
> 
> That said, it is possible to write a program which uses regular
> expressions and a stack-like data structure to parse balanced
> parenthesis.
> 
> That said, for this problem, something based on +/\-/'()'=/y would
> probably be more sensible.
> 
> Do you need an implementation?
> 
> Thanks,
> 
> -- 
> Raul
> 
> 
> On Sun, Dec 25, 2016 at 11:10 AM, bill lam <[email protected]> wrote:
> > Season's Greetings!
> >
> > Is it possible to use regex to find the first index
> > unmatched )(
> >
> > eg. for the line
> > a + ((mno - rst) % b  NB. unmatched paren
> >     ^
> > 01234
> >
> >
> > --
> > regards,
> > ====================================================
> > GPG key 1024D/4434BAB3 2008-08-24
> > gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> > gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to