I have a string:

```
st = "Dee Fee, MD is a good person. Kas Egre, MD came here"

```

I want to replace `", MD"` with `"Name:"` and put it before name, so the new string should be:

`new = "Name: Dee Fee is a good person. Name: Kas Egre came here"`

I write the following code, it works, but it does not give what I want. The result is this:

```
Name: Dee Fee, MD is a good person. Name: Dee Fee, MD came here    
Name: Kas Egre, MD is a good person. Name: Kas Egre, MD came here 

```

This is my code:

```
rename = re.compile(r"""([A-Z][a-z]+\s[A-Z\s]*[A-Z][a-z]+)(,\s)(MD)""")
match = rename.search(st)
for match in rename.finditer(st):
    if match.group(3) == 'MD':
        new = rename.sub("Name: %s"%(match.group(0)),st)
        print new

```

how can I fix my code? Thanks for help