in reply to How do I match a string that is NOT at the end of a line?
perl -ne 'my $string="perlmonks"; if (/$string/) { if (!/$&$/) { print } }'
If you have a match before the end and at the end you will have to define what do you want
Regards,
|
|---|