Advertisement
here2share

# utf-8_and_insert.py

Aug 5th, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. # utf-8_and_insert.py
  4.  
  5. import re
  6.  
  7. zzz = '''
  8. document
  9. '''
  10.  
  11. t=''
  12. for z in zzz:
  13.     if ord(z) > 127: z="'"
  14.     t+=z
  15. #
  16. t = re.sub("'+","'",t)
  17. t = re.sub(r"([a-z])(\d)",r"\1 \2",t)
  18. print t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement