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
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
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
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 s
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