Advertisement
Guest User

Untitled

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