Re: searching a string

2003-03-18 Thread Octavian Rasnita
Sent: Tuesday, March 18, 2003 1:13 PM Subject: searching a string Hi i am searching for a string of consecutive words say "the lucky coin" These may be in one line or different line separated by blank lines such as 1>the lucky coin 2>thelucky c

Searching a string from a file

2003-03-18 Thread mark sony
Note: Forwarded message attached -- Orignal Message -- From: "mark sony" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Re: searching a string ___ Odomos - the only mosquito prot

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

searching a string

2003-03-18 Thread mark sony
Hi i am searching for a string of consecutive words say "the lucky coin" These may be in one line or different line separated by blank lines such as 1>the lucky coin 2>thelucky coin 3>the lucky coin Whats the way in perl ? mark ___