Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # string_remove_non_english_minus_specifics <<< Revised
- import re
- myString = " abc_!@#$%^&*=()[]{}123 +A-Z's`~<>? "
- myString = myString.replace('_',' ')
- myString = myString.replace(' & ',' and ')
- myString = re.sub(r"[^0-9a-zA-Z()\[\]',$\- ]+", '', myString) ###
- myString = ' '.join(myString.split())
- myString = myString.strip()
- print myString
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement