Using variables in Python regular expression,re.compile('{}-\\d*'.format(user))