Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-02-23 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (349 votes). Check out past polls.