For example:
import re
s1 = 'LOGO 设计'
## s2 = '设计 LOGO'
s = re.sub('[a-zA-Z0-9]{3,}(\s)[^a-zA-Z0-9]', '', s1)
print(s)
I want to find at least 3 ascii chars, followed by a space, then followed by a nonascii char, and replace the white space with empty string. My code has two issues:
How to write the replacement string for (\s)?
How to make it also work for the reverse order of s2?:
[^a-zA-Z0-9]