regsub backreference question

Michael Esveldt dante at
Thu Apr 27 04:43:19 CEST 2000

I'm trying to figure out how back referencing works in python's regsub 
module. I thought the following code would simply double the string 
"foo" but it's just returning "foo".

regsub.sub(r"(.*)", r"\1\1", "foo")

What am I doing wrong here?

thanks in advance,
dante at - Michael Esveldt - #FightThePower on Openprojects

More information about the Python-list mailing list