Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: grep trouble

by LanX (Saint)
on Apr 17, 2011 at 15:45 UTC ( [id://899820]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<100> @patterns=qw#one two three#
     
    ...
     
      DB<103> print $str =~ m/($re)/g
    onetwo
    
  2. or download this
      DB<106> $str="two one two"
     
    ...
    twoonetwo
      DB<108> print grep {$str=~/$_/} @patterns
    onetwo
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://899820]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-29 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found