The problem got solved by if ($msg =~ /roam\s*act/i)
this will allow you to get the whole word without space or take it with
space.

though when you query you have to put the words under " ".


----- Original Message -----
From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
To: "Suvajit Sengupta" <[EMAIL PROTECTED]>
Cc: "K.Moeng" <[EMAIL PROTECTED]>; "beginners perl" <beginners@perl.org>
Sent: Wednesday, October 19, 2005 2:45 PM
Subject: Re: white space between roam and act


> On Oct 19, Suvajit Sengupta said:
>
> > To ignore the white space in between ROAM and ACT use /x modifier of
Perl RE
> > to extend your pattern's legibility by permitting  whitespace and
comments.
> > Hope that will serve your purpose.
> > Instead of
> >
> > if ($msg =~ /roam act/i)
> >
> > Use
> >
> > if ($msg =~ /roam act/ix)
>
> You're misunderstanding the /x modifier.  Using /x means that all
> whitespace in your regex is ignored, not that all whitespace in the STRING
> is ignored.  Only "roamact" is matched by /roam act/x, since the " " in
> the regex is ignored due to the /x modifier.
>
> --
> Jeff "japhy" Pinyan        %  How can we ever be the sold short or
> RPI Acacia Brother #734    %  the cheated, we who for every service
> http://www.perlmonks.org/  %  have long ago been overpaid?
> http://princeton.pm.org/   %    -- Meister Eckhart
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>



-- 
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