Actually, I have to test two conditions to get into a block, If the strings found are either "one two" or "two three", go ahead.
if ($text =~ /one two/ or /two three/) Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Forestières La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] > -----Original Message----- > From: James Edward Gray II [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 17, 2003 11:05 AM > To: Hemond, Steve > Cc: [EMAIL PROTECTED] > Subject: Re: Regular expressions > > > On Dec 17, 2003, at 9:59 AM, Hemond, Steve wrote: > > > Hi again, > > > > I want to make a search on two words. > > > > If 'one two' is found, it is okay. > > If 'one' is found, it is incorrect. > > If 'two' is found, it is also incorrect. > > > > I want the search to return me occurences of 'one two' > found together. > > > > I am searching this way : > > if ($text =~ /one two/) > > > > What I am doing wrong? > > Nothing that I can see. Although, /\bone two\b/ is probably > slightly > better. What's the problem? > > James > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>