I want to remove numbers from a string which is just placed after a word without any space. eg:
'Senku Ishigami is charecter from a manga series98 onging since 2017.'
should be:
'Senku Ishigami is charecter from a manga series onging since 2017.'
I could remove detect the numbers with a regex '[a-z]+[0-9]+'
, But when I can't understand how can I remove it. I tried to remove it by just writing '[a-z]'
, as I thought it would work, but it is just printing '[a-z]'
as a string .
Here is the code:
import re
text ='Senku Ishigami is charecter from a manga series98 onging since 2017.'
text = re.sub(r'[a-z]+[0-9]+', '[a-z]', text)
print(text)
output:
Senku Ishigami is charecter from a manga [a-z] onging since 2017.