[Tutor] (no subject)

"Andrés Chandía" andres at chandia.net
Wed Mar 30 02:21:31 CEST 2011


I'm new to this list, so hello everybody!.

The stuff:

I'm working with
regexps and this is my line:

contents = re.sub("<u>l<\/u>",
"le" ,contents)

in perl there is a way to reference previous registers,
i.e. 

$text =~ s/<u>(l|L|n|N)<\/u>/$1e/g;

So I'm looking for
the way to do it in python, obviously this does not works: 

contents =
re.sub("<u>(l|L|n|N)<\/u>", "$1e", contents)

Thanks


_______________________
            andrés
chandía

P No imprima
innecesariamente. ¡Cuide el medio ambiente!




More information about the Tutor mailing list