regexp help

globalrev skanemupp at yahoo.se
Fri May 9 18:19:26 EDT 2008


i want to a little stringmanipulationa nd im looking into regexps. i
couldnt find out how to do:
s = 'poprorinoncoce'
re.sub('$o$', '$', s)
should result in 'prince'

$ is obv the wrng character to use bu what i mean the pattern is
"consonant o consonant" and should be replace by just "consonant".
both consonants should be the same too.
so mole would be mole
mom would be m etc




More information about the Python-list mailing list