Skip to content

Instantly share code, notes, and snippets.

@allieus
Last active March 23, 2017 03:26
Show Gist options
  • Save allieus/0c195f8fc27e4c738d30ff38179285a1 to your computer and use it in GitHub Desktop.
Save allieus/0c195f8fc27e4c738d30ff38179285a1 to your computer and use it in GitHub Desktop.
import re
s = "I80:K180"
result = re.sub(r'\d+', lambda obj: str(int(obj.group(0))+1), s)
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment