Assume there’s a string
"striiiiiing". I need to replace the
'str******ng'. The number of
'*' must be same as
'i'. However, if the number of
'i' is less than 3 then there is no need to make any changes.
How can we do that using regex?
Source: Python-3x Questions