Add '$' to every regex before match.
Added exclude of temporary files (*~).