cache the result of filepath.Match()