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
> the carriage return between the parenthesis? $OrigString =
>
"REQUEST(SERVICE,1DJGHKDFJGHDFJGHKDFJH\nDFJHGDFJHGJDFHGJKDFHG\nHGJDFHGJK
DFHGJKDFHGJKDFH);";
> $OrigString =~ m/REQUEST\((.*)\);/;
> print "$1\n";

Read perlre, about the s-modifier. I also added non-greediness.

  $OrigString =~ m/REQUEST\((.*?)\);/s;


Or use this variant:

  $OrigString =~ m/REQUEST\(([^)]*)\);/;

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to