cache file extension regexp instead of recompiling it every time