But it only removes the 1st line, and doesn't look for other lines. Please let me know.
That's because once $flag is set to zero, it will always be zero. There is no place in your code where it can be reset to 1. You will have to re-think the fine detail of your algorithm.
In reply to Re: match a word and delete last line
by hippo
in thread match a word and delete last line
by ArifS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |