I have a text like this: it's level I, not level II or level III.
I want the I after level to turn into 1 and only on level I.
I tried this code : text = re.sub(r'(level I)+[\s,.]',r'level 1 ',text)
But i get my output like this: it's level 1 not level II or level III.
and the comma is skipped which i don't want it to be ignored. also in some cases
i have the word Level not level.