I would like to skip the line if it contains a word “group”. This word can occur anywhere in that line. How do I achieve in a single regex?
This is so simple, I think there must be more than your simple requirement.use Modern::Perl; while (<DATA>){ print $_ unless /\bgroup\b/; } __DATA__ This line is OK This line should be skipped: 'group' Drop this group too But keep this grouped content
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: Excluding Words in RegEx
by CountZero
in thread Excluding Words in RegEx
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |