Regular expressions newbie: something for templates

Thomas Weholt thomas at weholt.org
Sun Mar 10 17:35:58 EST 2002


Hi,

I'm not getting the hang of regular expressions. All I want to do is this.

Take string #1 :

"This is the test $var1$ and this is $var2$"

and turn it into

"This is the test %(var1)s and this is %(var2)s"

Any clues?

( And yes, yet another template system in the works ;-) )

Thomas







More information about the Python-list mailing list