Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Pattern Matching Exercises

by pedagogues (Initiate)
on Nov 27, 1999 at 21:54 UTC ( #1017=perlexercise: print w/replies, xml ) Need Help??

Pattern Matching Exercises

  1. Write a program which asks the user for a filename, then modifies that file, replacing each tab (\t) character with 3 spaces. (solution)
  2. Write a program which reads in lines of text and for each one prints "Weekend!" if the line contains "Saturday" or "Sunday", and for the other days of the week prints "This is a workday." Ignore capitalization in your regular expression. (solution)
  3. Write a program which reads in lines of text and for each line does the following: find the "words" (sequences of non-whitespace characters) and print each one on a line by itself. (solution)
Log In?

What's my password?
Create A New User
Domain Nodelet?
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 2023-03-30 04:40 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (73 votes). Check out past polls.