I want to delete copies of 'i' in this example, tried using groups but it's not working. Where am I doing this wrong?
import re
a = '123iiii'
b = re.match('.*i(i+)', a)
print(b.group(1))
>>> i
a = re.sub(b.group(1), '', a)
print(a)
>>> 123
Desired result is '123i'.
Thanks for the answer.
