regexp for bracket expression

R

rembremading

Hi all!

I am using regular expressions quite a lot.
But somthing I don't know, so far, is if there exists an
regexp matching anything which has equally many opening and closing
brackets, e.g.

(.(..)..(...(...))..)

Any idea?

Sorry for cross posting

Thank You!
 
P

Paul Lalli

Hi all!

I am using regular expressions quite a lot.
But somthing I don't know, so far, is if there exists an
regexp matching anything which has equally many opening and closing
brackets, e.g.

(.(..)..(...(...))..)

You have asked a Frequently Asked Question.
$ perldoc -q balance
Found in /software/perl-5.8.5-0/pkg/lib/5.8.5/pod/perlfaq6.pod
Can I use Perl regular expressions to match balanced text?
Any idea?

As the FAQ answer states, check out Regexp::Common and Text::Balanced.
Sorry for cross posting

You did not cross post this message. It was sent only to
comp.lang.perl.misc. If you also sent it to other groups, you must
have done it via multiposting, not crossposting. Please don't do that
again. It's extremely rude.

Paul Lalli
 
R

rembremading

Paul said:
You have asked a Frequently Asked Question.
$ perldoc -q balance
Found in /software/perl-5.8.5-0/pkg/lib/5.8.5/pod/perlfaq6.pod
Can I use Perl regular expressions to match balanced text?


As the FAQ answer states, check out Regexp::Common and Text::Balanced.
That helped me, thank you!
You did not cross post this message. It was sent only to
comp.lang.perl.misc. If you also sent it to other groups, you must
have done it via multiposting, not crossposting. Please don't do that
again. It's extremely rude.
The reason was, that I first posted the same (english) text accidentally in
the german .perl.misc group. This is probably a bad idea. I didn't do it on
purpose.
 

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

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,675
Latest member
RollandKna

Latest Threads

Top