If the text is contained in $text, then:
if ($text =~ /the\s+lucky\s+coin/ism) {
print "ok";
}
Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]
- Original Message -
From: "mark sony" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 1:13 PM
Sub
Hi
It is giving the found status everytime even when there are no
strings:
My script:
#!/usr/local/bin/perl -w
#use strict;
#use warnings;
while () {
$string = "the\n\tlucky\n\t\tcoins";
if ($string =~ m/^(\s)*the(\s)*lucky(\s)*coins(\s)*$/) {
print "Yup,exists.\n";
} else {
print "nope \n";
}
}
$string = "the\n\tlucky\n\t\tcoin";
if ($string =~ m/^(\s)*the(\s)*lucky(\s)*coin(\s)*$/) {
print "Yup";
}
What I would do is elliminate all the extra white space;
s/\w/ /g; s/\r\n/ /g;
then do a match.
/the lucky coin/;
Dennis
- Original Message -
From: "mark sony" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 02 13
Subject: searching a string
> Hi
> i am sear