import res = "11 12 13 14"res = re.sub(r'\d+', lambda x: str(int(x.group()) + 1), s)print(res)
Standard input is empty
12 13 14 15
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!