Steve,
I'm not sure if this is what you want, but check out the "balancing groups"
construction in .NET regular expressions. This feature can be used to search
for matching parenthesis, but it is a bit arcane. It allows named captures
to be manipulated on a push-down/pop-up stack. It can also be used to find
matching HTML tags or any other nested construct.
If you download Expresso (
http://ultrapico.com), as suggested by Cor
Ligthert, load the Tutorial and select example number 44 from the regular
expression library. It will seach for a left parenthesis and then capture
all the text up to the matching right parenthesis.
This feature is very poorly documented in the Microsoft documentation. It is
discussed in some detail in Jeffrey Friedl's excellent book. Chapter 9 of
that book is available on line. See pat 430 for the section on "Matching
Nested Constructs".
http://www.oreilly.com/catalog/regex2/chapter/ch09.pdf
I hope this helps.
Jim
"Steve Kirsch" <te**@test.com> wrote in message
news:e$****************@TK2MSFTNGP10.phx.gbl...
I need a simple function that can match the number of beginning and ending
parenthesis in an expression. Here's a sample expression:
( ( "john" ) and ( "jane" ) and ( "joe" ) )
Does .NET have something built-in that can accomplish this, or do I have
to
write my own parser? I don't want to reinvent the wheel if possible.