Search word 2003 for unclosed ( ,[ or { sets

  • Thread starter Thread starter billob
  • Start date Start date
B

billob

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Find [ or ] but not [ ] 1
"Requery"? 1
unclosed connections problem 5
Forcing odp.net connection 1
pop-up reminders 1
SP3 Problem (maybe) 8
is Nothing vs = Empty 5
Connection Pool Time Out 4

Back
Top