str = """This is a note[*] and this is another[*]
[*]: note 1
[*]: note 2"""
reg = '(.*?)\\[\\*\\](.*?)\\[\\*\\]: (note \\d)(.*)'
while re.search(reg, str, flags=re.MULTILINE | re.DOTALL):
    str = re.sub(reg, '\\1\\\\footnote{\\3}\\2\\4', str, flags=re.MULTILINE |
        re.DOTALL)
str
Python Regular expression only matches once