How to use python regular expression to substitute string value

Allerdyce.John at gmail.com Allerdyce.John at gmail.com
Sun Feb 26 13:35:32 EST 2006


Hi,
I am new to python. I would like to know how to use python regular
expression to substitute string value?
I have an input string like this:
x:11 y:0 w:760 h:19 area:14440 areaPerCent:0
totalAreaPerCent:-3.08011e+16 type:3 path:///-/1/1

and I would like to convert it to:
rect x="11" y="0" width="760" height="14440"

all I care about the input string is x, y, w, h.

Thank you for any pointers.




More information about the Python-list mailing list