Hello Bill
What I want to find out is if I can search for unclosed [,{. 0r(. I have
no problem searching for a left or a right side but my document contains
like 2000 [ and 1999] and I am trying to find the unclosed set.
I pondered a bit on this, and I feel there's no simple solution to your
problem.
I've come up with a crude algorithm that uses a wildcard search run
which stops whenever it encounters, say, an opening or closing bracket.
I'd add a counter that starts at zero, increases for every opening
bracket and decreases for a closing bracket. You basically are fine if
a) your counter never becomes a negative number, and
b) your counter is zero once you reach the end of the document.
Problem is, if you come to the end and your counter is still >0, then
what? If you have something like:
dummy (text dummy) text (dummy text
It's clear which is the odd bracket.
dummy (text dummy (text dummy text)
That case, how would anybody know whether the first or the second
opening bracket is the odd one? That's the real problem: if one bracket
is missing, you don't have a set anymore.
Mind you, I'm no developer and it's likely somebody else could come up
with a better approach.
0.02cents
Robert