import retext = "Hi. My name is _John_. I am _20_ years old."pattern = "_([^_]*)_"print re.sub(pattern, r'<b>\1</b>', text)
Standard input is empty
Hi. My name is <b>John</b>. I am <b>20</b> years old.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!