Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

String matching and Regular Expressions

by root (Scribe)
on Nov 10, 1999 at 03:50 UTC ( #962=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while(<>){
       if(/the/){    #does $_ contain the
          print "Your line of text contains the word 'the'\n";
       }
    }
    
  2. or download this
    @machines_os=("OpenBSD","Windows","Linux", "Windows");
    foreach(@machines_os){
       s/Windows/Linux/;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2014-07-10 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (199 votes), past polls