Re: Regular expression to match surrounding parenthesis
From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 07/07/04
- Next message: Scott J: "Re: sorting hash based on keys and replacing them in the same hash"
- Previous message: Purl Gurl: "Re: Regular expression to match surrounding parenthesis"
- In reply to: Bob: "Regular expression to match surrounding parenthesis"
- Next in thread: Abigail: "Re: Regular expression to match surrounding parenthesis"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 07 Jul 2004 20:47:02 +0200
Bob wrote:
> 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.
What about nesting?
The CPAN module Text::Balanced might be helpful.
-- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
- Next message: Scott J: "Re: sorting hash based on keys and replacing them in the same hash"
- Previous message: Purl Gurl: "Re: Regular expression to match surrounding parenthesis"
- In reply to: Bob: "Regular expression to match surrounding parenthesis"
- Next in thread: Abigail: "Re: Regular expression to match surrounding parenthesis"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|