Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> test = lambda string: re.sub(r'\d{4,}', lambda match: ','.join(re.findall(r'\d{1,3}', match.group(0)[::-1]))[::-1], str(string))
- >>> test('Hi ! Im born in 1994, and you?')
- 'Hi ! Im born in 1,994, and you?'
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement