import res = "python is programming language p"print(re.sub(r'\bp(?=[^\W\d_])', '2', s, flags=re.I))print(re.sub(r'\bp\B', '2', s, flags=re.I))
Standard input is empty
2ython is 2rogramming language p 2ython is 2rogramming language p
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!