class RegexMatchTooMuch(Exception): pass


# set up pattern
pattern = re.compile(r'''          
    ^["]*           # text may or may not start with "
    (               # start defining group to return
        [^"]*       # the first character is not "
        \.          # next is .
        csv         # next is csv
    )               # end defining the group to return
    ["]*$           # text may or may not end in "
''', re.VERBOSE+re.IGNORECASE)
reres = pattern.findall('report for RIUD .csv')

if len(reres) == 1:
    print(reres[0])
elif len(reres) == 0:
    print('No match')
else:
    raise RegexMatchTooMuch