Re: Regular expression to match surrounding parenthesis

From: Abigail (abigail_at_abigail.nl)
Date: 07/07/04


Date: 07 Jul 2004 19:09:53 GMT

Bob (bob_nf@hotmail.com) wrote on MMMCMLXIII September MCMXCIII in
<URL:news:84c27559.0407071023.3aed77@posting.google.com>:
[] Hi,
[]
[] I am trying to create a regular expression to verify that user entered
[] data is surrounded by the same number of open and closed parenthesis.
[]
[] For example: if 'a' was the expression I was trying to match then a,
[] (a), ((a)), (((a)))... (((((((a))))))) would all be valid.
[]
[] I am not new to regular expressions but I am also not an expert. I
[] have spent hours searching for a solution but no luck.

You spend hours looking? Where did you look? The place I would look
first, the documentation that comes with Perl, mentions a regular
expression doing this.

[] Is this possible and if so any help would be appreciated?

Try helping yourself first.

Abigail

-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


Relevant Pages

  • Re: RegEx to delete // comments NOT in quotes: ( ) OR (")???
    ... W. D. wrote on MMMCMIX September MCMXCIII ... }} I am about to ship myself to a mental hospital! ... }} out a regular expression to strip out comments that begin ...
    (comp.lang.perl.misc)
  • Re: Regular expression questions
    ... Hung Truong wrote on MMMCMIII September MCMXCIII in ... :) I'm new at this regular expression. ... How can I do a match for strings that ...
    (comp.lang.perl.misc)
  • Re: regular expression for wc
    ... Zeh Mau wrote on MMMMCMLXXXIII September MCMXCIII in ... Well, that's quite rude. ... If you restrict yourself to what the regular expression engine can without ... falling back to Perl, than the answer is "no", for a very simple reason: ...
    (comp.lang.perl.misc)
  • Re: exclude regular expression
    ... ^^ How can I do this with regular expression? ... It's unclear what you want, ...
    (comp.lang.perl.misc)
  • Re: [expect] using the previous output as input
    ... > of an expect send clause? ... Of course you have to verify this regular expression whether it matches your ... expect sets during "expecting". ...
    (comp.lang.tcl)