Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/userp/hh.py
2020-06-13 20:43:43 +08:00

20 lines
No EOL
425 B
Python

import re
def hh(w):
value = w
length = len(value)
utf8_length = len(value.encode('utf-8'))
length = (utf8_length - length) / 2 + length
if int(length)>15:
w = re.findall('..?.?.?.?.?.?.?.?.?.?.?.?.?.?', w)
w = str(w)
w = re.sub('\[','',w)
w = re.sub('\]','',w)
w = re.sub(',','-\n',w)
w = re.sub('\'','',w)
return(w)
else:
return(w)