Re: searching a string

2003-03-18 Thread Octavian Rasnita
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

Re: Re: searching a string

2003-03-18 Thread mark sony
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"; } }

Re: searching a string

2003-03-18 Thread WilliamGunther
$string = "the\n\tlucky\n\t\tcoin"; if ($string =~ m/^(\s)*the(\s)*lucky(\s)*coin(\s)*$/) { print "Yup"; }

Re: searching a string

2003-03-18 Thread Dennis Stout
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