help with the regular expression

2007-03-21 Thread Boga Srinivas
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 unsubs

Re: help with the regular expression

2007-03-21 Thread Jason Roth
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

Re: help with the regular expression

2007-03-21 Thread Chas Owens
On 3/22/07, Boga Srinivas <[EMAIL PROTECTED]> wrote: snip $str =~ /hello:\s0(.*)hello:\s1/; snip Contrary to popular opinion . does not match all characters by default. To get it to match \n you must use the s option with your regex like this $str =~ /hello:\s0(.*)hello:\s1/s; -- To unsubscr