On Wed, Dec 20, 2006 at 02:56:28PM +0700, beast wrote:
> 
> Hi All,
> 
> Basically I want these input :
> name=
>    name=
> name        =
>    name   =
> 
> But I did not want these input:
> my name =
> name is =
> my name is =
> 
> --
> 
> if ( /\s*name\s*=/) {
>      print "Match: $_";
> }
> 
> did not works as i expected.

At a wild guess, I'd say that you're probably getting the matches you
want, plus getting the "my name =" as a match.  The reason is that you
didn't specify that the leading spaces before the word "name" must be at
the beginning of the line.  For that, use "^".  Use "perldoc perlre" to
learn more about it.

-- 
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"It's just incredible that a trillion-synapse computer could actually
spend Saturday afternoon watching a football game." - Marvin Minsky

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to