This regex is too liberal.  It will match weird stuff like:   <code>"ra------0x-1+mca</code>.  Also, groups are not required, since we next extract them.

Use something like this instead:

     re.match(r"^r\.-?\d+\.-?\d+\.mca$", f)