Hope this should have been asked before, but I am not able to search what I was looking for. Here I am reading from a data file line by line and process each line.
my $Line = "1243 That will efficiently match a nonempty group with mat +ching parentheses two levels deep or less."; if( $Line =~ /^(\d{4}) ([^\.]+?[\.\!\?])$/ ) { print "$1\n$2\n"; #Do something } elseif( #do some other check }
In the above example 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? Currently I save $2 in a variable and check for word “group”. This makes my life difficult as I have to continue the elsif loot if “group” present. Appreciate your help.
In reply to Excluding Words in RegEx by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |