CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
regex help

 



quintus
Novice

Sep 8, 2011, 12:22 AM

Post #1 of 3 (3287 views)
regex help Can't Post

Text format:
(text1)
text2
(text3)

1. I need regex to match text beetween first set of parentheses. Results: text1.
2. I need regex to match text beetween first set of parentheses and second set of parentheses. Results: text2.
3. I need regex to match text beetween second set of parentheses. Results: text3.

please give me a little help.
Thanks


rovf
Veteran

Sep 9, 2011, 1:20 AM

Post #2 of 3 (3273 views)
Re: [quintus] regex help [In reply to] Can't Post

Text::Balanced


rovf
Veteran

Sep 9, 2011, 1:22 AM

Post #3 of 3 (3272 views)
Re: [quintus] regex help [In reply to] Can't Post

or here:

http://stackoverflow.com/questions/2700613/how-can-i-extract-a-string-between-matching-braces-in-perl

BTW, with this type of question, you should always specify which Perl version you are using. Otherwise people might suggest a solution which doesn't work in your Perl.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives