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
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\(
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 =~
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
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
.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
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
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