fixed regexp matching $ instead of eol