> > ... > > Date: Thu, 23 May 2002 19:47:50 +0530 > > ... > > $header = $1 if /^Date: (.*)/; > This should do what you want.
Two things: 1) should anchor this regex to the end of the line to make sure you get the entire line in $1 2) should use the //m switch to treat your string as multiple lines[1] (assuming you have the entire header in one string) $header = $1 if /^Date: (.*)$/m; Cheers, -dave [1] from perldoc perlre: /m Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]