Hi,
are you sure that this will really solve your problem? What about curly braces in comments?
I don't think I'd reinvent the wheel this way. I'd rather try to get some already more sophisticated machine setup to fullfill my wishes. Maybe one could use the programming mode of his/her favorite editor, which probably already does some checking like this. I could also imagine that indent and gcc or some TAGs creating programms might be helpfull. Or in XEmacs you might want to call M-x occur RET [{}] (I had rather used a tt-font here, but I needed to use code-Tags to get the brackets) or maybe M-x count-matches RET { and then compare to the count of }.

I know that this doesn't quite answer your question, which has been adressed above. It just shall save you from further problems...

Regards... Stefan
you begin bashing the string with a +42 regexp of confusion


In reply to Re: finding { and } by stefan k
in thread finding { and } by dudi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.