Yeah, this is a little confusing. In the extension `.jst.hbs` the "real" filetype is `.hbs`. If you're familiar with Rails' asset pipeline, the same pattern exists in preprocessed assets: `test.js.coffee` where `.coffee` is the target type.

`\S+` treats all chained extensions as a single extension where `\w+` looks at only the last dot-segment. I think this may be more representative of the real file type.

Alternatively, you could capture all extensions (`\S+`) and split them, look for comments for each extension, then fallback on the filename.