Wednesday, 28 August 2013

Special Case to Replace String Using Python with Regex

Special Case to Replace String Using Python with Regex

I'd like to replace decimal point but not period in one content.
For example:
Original Content:
This is a cake. It is 1.45 dollars and 2.38 kg.
Replaced Content:
This is a cake. It cost 1<replace>45 dollars and 2<replace>38 kg.
How can I use Python Regex to do it ?
Thank you very much.

No comments:

Post a Comment