Sometimes the `fname` will be parsed as (I've no idea why it happens in that way): `C:\Program Files (x86)\vim\[18*No Name]` So the result of regex `matchstr(fname, '\d\+')` will be `86`, which is obviously incorrect.