Re: Including the carriage return in extraction

2008-06-16 Thread Dr.Ruud
Gunnar Hjalmarsson schreef: > I don't > see how the fact that you posted it would motivate your introducing of > non-greediness in the first suggestion. I injected the "non-greediness" for educational reasons. It was a bit wasted on the OP, who couldn't find his way in perlre. My experience is th

Re: Including the carriage return in extraction

2008-06-16 Thread Gunnar Hjalmarsson
Dr.Ruud wrote: Gunnar Hjalmarsson schreef: Dr.Ruud: Ravi Malghan: I want to extract data between the first parenthesis and the last in the below variable. $OrigString = "REQUEST(SERVICE,1DJGHKDFJGHDFJGHKDFJH\nDFJHGDFJHGJDFHGJKDFHG\nHGJDFHGJK DFHGJKDFHGJKDFH);"; $OrigString =~ m/REQUEST\(

Re: Including the carriage return in extraction

2008-06-16 Thread Dr.Ruud
Gunnar Hjalmarsson schreef: > Dr.Ruud: >> Ravi Malghan: >>> I want to extract data between the first parenthesis and the last >>> in the below variable. > > > >>> $OrigString = >>> "REQUEST(SERVICE,1DJGHKDFJGHDFJGHKDFJH\nDFJHGDFJHGJDFHGJKDFHG\nHGJDFHGJK >>> DFHGJKDFHGJKDFH);"; >>> $OrigString =~

Re: Including the carriage return in extraction

2008-06-16 Thread Gunnar Hjalmarsson
Ravi Malghan wrote: I read up some docs on perlre. I know what .* does. But couldn't figure out what does .*? does. That's also explained in "perldoc perlre". Look for "greedy" and "greediness" in the section "Quantifiers". (But it's unnecessary in this case IMO.) Also in the variant you su

Re: Including the carriage return in extraction

2008-06-16 Thread Gunnar Hjalmarsson
Dr.Ruud wrote: Ravi Malghan schreef: I want to extract data between the first parenthesis and the last in the below variable. $OrigString = "REQUEST(SERVICE,1DJGHKDFJGHDFJGHKDFJH\nDFJHGDFJHGJDFHGJKDFHG\nHGJDFHGJK DFHGJKDFHGJKDFH);"; $OrigString =~ m/REQUEST\((.*)\);/; print "$1\n"; Read

Re: Including the carriage return in extraction

2008-06-16 Thread Ravi Malghan
.Ruud <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Sunday, June 15, 2008 8:55:31 PM Subject: Re: Including the carriage return in extraction Ravi Malghan schreef: > Hi: I want to extract data between the first parenthesis and the last > in the below variable. I have tried a numbe

Re: Including the carriage return in extraction

2008-06-15 Thread Dr.Ruud
Ravi Malghan schreef: > Hi: I want to extract data between the first parenthesis and the last > in the below variable. I have tried a number of combinations. I > either miss the entire string or get data only until the first > carriage return. Can someone help me to extract the data including > th

Including the carriage return in extraction

2008-06-15 Thread Ravi Malghan
Hi: I want to extract data between the first parenthesis and the last in the below variable. I have tried a number of combinations. I either miss the entire string or get data only until the first carriage return. Can someone help me to extract the data including the carriage return between the