Re: [Jprogramming] unmatched parenthesis

2016-12-25 Thread 'Jon Hough' via Programming
There's always FParsec: (F# code) Something like... let InsideParens = pstring "(" >>. (manyChars (noneOf ")")) .>> pstring ")" will parse all characters between ( and ) but will not check if the enclosed characters also have balanced parentheses. For that you will need to change the parser st

Re: [Jprogramming] unmatched parenthesis

2016-12-25 Thread bill lam
I found this page https://msdn.microsoft.com/en-us/library/bs2twtah.aspx c# regex has an extension called balanced group. But I still cannot find how to match unbalanced group. Вс, 25 дек 2016, Raul Miller написал(а): > For that case, I'd code it in J, first, so that I could be sure it > works, a

Re: [Jprogramming] unmatched parenthesis

2016-12-25 Thread Raul Miller
For that case, I'd code it in J, first, so that I could be sure it works, and then translate that implementation to C#. I think regex is a red herring here, because (a) regular expressions cannot handle parenthesis balancing by themselves, and (b) the regex implementation which J uses does not hav

Re: [Jprogramming] unmatched parenthesis

2016-12-25 Thread bill lam
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 написал(а):

Re: [Jprogramming] unmatched parenthesis

2016-12-25 Thread 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 s

[Jprogramming] unmatched parenthesis

2016-12-25 Thread bill lam
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 --re