Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regexp question

by Abigail-II (Bishop)
on Aug 19, 2002 at 16:01 UTC ( #191212=note: print w/replies, xml ) Need Help??


in reply to regexp question

{ local $" = "|"; $line =~ /@{[map {quotemeta} @query]}/; }

Replies are listed 'Best First'.
Re: Re: regexp question
by kidd (Curate) on Aug 19, 2002 at 16:08 UTC
    Thanks...it worked grrreat... :-)

    Just one more thing...how could I check that all the words in the array are in the line?

    Thanks

      By not being smart and wanting it in a single regexp. Use your foreach loop and a counter. Increment the counter for each match found, and compare after the loop whether the counter equals the size of the array. Or just bail out whenever there isn't a match, depending a bit on what exactly you want to do.

      Abigail

        Yupi!!!

        I did it...thanks for your help...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://191212]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2016-12-11 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.