http://qs321.pair.com?node_id=69270


in reply to Sorry message

In the future, you may want to use some HTML along with <code> tags to format the content of your question.

You need a variable to track whether a match was found. I recommend setting it to 0 before the while loop, then incrementing it for each match. After the while loop, if the variable is false (still equal to 0) then print your "not found" message. This technique has the added benefit of providing you with the number of matches.