foo bar barbar belland the pattern is /bar/. bar will match; if you read in the next line and print it out, you won't notice that barbar also matches, and so won't print out bell. You could add some code to fix this, but the flag approach handles it quite nicely.
In reply to Re^3: Getting next line after matched one
by sgifford
in thread Getting next line after matched one
by ramthen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |