@ranbena - I think this is fine. The only thing I'd change is that you can probably just remove the first non-escaped dot.

```
file.match(/([^\.]+)$/)[1]; 
```