in reply to How do I match a string that is NOT at the end of a line?

I would use $Match variable (seems like firefox doesn't like anchor with $ character, so maybe you can to move to $& manually), though it has performance issues:
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,
  • Comment on Re: How do I match a string that is NOT at the end of a line?