Hi Srini, you're going to want to add an s to the end of your regex,

$str =~ /hello:\s0(.*)hello:\s1/s;

This will cause the . in your regex to match newlines which it
normally does not.

-Jason


On 3/22/07, Boga Srinivas <[EMAIL PROTECTED]> wrote:
Hi,

I am trying to capture the data between 2 patterns.

The following is the code snippet.

  $str="hello: 0
        fj
gerkjiuiojijgre
kgoerkgop
hello: 1";

$str =~ /hello:\s0(.*)hello:\s1/;

$title = $1;

print $title;


But this does not work.

Can any one help me

~Regards
Srini


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




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


Reply via email to