Better extension regexes

I'm not aware of any places where this is actually causing a problem, but we should use `\z` instead of `$`.