Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- message = "12345678"
- print("{0}".format(re.sub(r'[0-9](?=(?:[0-9]{3})+(?![0-9]))', '\g<0>,', str(message))))
- # output: 12,345,678
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement