user = 'heinz'
import re
regex = re.compile('%s-\\d*' % user)
regex.match('heinz-1')
regex.match('heinz-11')
regex.match('heinz-12345')
regex.match('foo-12345')
Using variables in Python regular expression