text = '<b*>Test</b>'
left_identifier = '<b*>'
right_identifier = '</b>'
s = '{}(.*?){}'.format(*map(re.escape, (left_identifier, right_identifier)))
s
re.findall(s, text)
Regex to extract between two strings (which are variables)