For each line, it either prints the line plus hello (if it's the marker line) ...That is not entirely true.
The test checks if the line contains the literal text "The marker line", but there could be other text before or after it. However, it wil then only print "The marker line" into the file, actually discarding some "garbage" text.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re^2: regular expression
by CountZero
in thread regular expression
by toniax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |