import reregex_match = re.compile(r'(?<!\w){}(?!\w)'.format(re.escape('.net')))print(regex_match.sub('.NET', 'I like my.net'))
Standard input is empty
I like my.net
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!