I Want to replace the 'REF ' tag to 'REF:'.

Please check the below code:-

```
def test():
    str_data = "REF PUNE UNIVERCITY BMS:KOLHAPUR UNIVERSITY REF NO : MUMBAI UNIVERSITY"
    tag_list = ["REF ", "BMS:", "REF NO :"]
    for each_value in tag_list:
        if each_value[-1] == " ":
            print(each_value)
            str_data = str_data.replace(each_value, each_value[:-1] + ":")
            print(str_data)

test()

```

I tried to solve it but I got the below output.

`Original String = "REF PUNE UNIVERCITY BMS:KOLHAPUR UNIVERSITY REF NO : MUMBAI UNIVERSITY"`

`My Result = REF:PUNE UNIVERCITY BMS:KOLHAPUR UNIVERSITY REF:NO : MUMBAI UNIVERSITY`

`Expected Result = REF:PUNE UNIVERCITY BMS:KOLHAPUR UNIVERSITY REF NO : MUMBAI UNIVERSITY`

Is there any way to resolve it? Is there any regex expression?