On Wednesday, April 24, 2002, at 02:45 , Kevin Cornmell wrote:
[..]
> Or try anchoring that regex.
>
> if ($radentry =~/\n\n$/){
> foo;
> }
this rules.
> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
[..]
>> Quick question. How can I check if the last two ch
Good catch. That's what I meant. :)
-Original Message-
From: David Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 8:51 AM
To: 'Kevin Cornmell '; [EMAIL PROTECTED]; 'Timothy Johnson'
Subject: RE: Patterm Matching
> Actually, \n's ar
> Actually, \n's are the one thing that the $ anchor doesn't
> work exactly right on. Usually it's not a huge deal, but
> Perl will still match a line that has a \n after the part
> that you are trying to match if you use $ to anchor. This is
> normally very useful, as in the case of a line
f a string.
$radentry =~ /\n\n\Z/;
-Original Message-
From: Kevin Cornmell
To: '[EMAIL PROTECTED]'
Sent: 4/24/02 2:45 AM
Subject: RE: Patterm Matching
++
Please read the disclaimer at the bottom of this e-mail.
+
PROTECTED]]
Sent: Wednesday, April 24, 2002 10:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Patterm Matching
Andrew Tait wrote:
> Hi All,
Hello,
> Quick question. How can I check if the last two characters of a string are
> both new line's (i,e, \n)
>
> This is what I have
Andrew Tait wrote:
> Hi All,
Hello,
> Quick question. How can I check if the last two characters of a string are
> both new line's (i,e, \n)
>
> This is what I have come up with so far:
>
> if ($radentry =~ /"*\n\n/")
if ( substr( $radentry, -2 ) eq "\n\n" )
John
--
use Perl;
program
fulfi