Advertisement
here2share

# string_remove_non_english_minus_specifics *

May 28th, 2015
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # string_remove_non_english_minus_specifics <<< Revised
  2.  
  3. import re
  4.  
  5. myString = "   abc_!@#$%^&*=()[]{}123   +A-Z's`~<>?   "
  6.  
  7. myString = myString.replace('_',' ')
  8. myString = myString.replace(' & ',' and ')
  9. myString = re.sub(r"[^0-9a-zA-Z()\[\]',$\- ]+", '', myString) ###
  10. myString = ' '.join(myString.split())
  11. myString = myString.strip()
  12.  
  13. print myString
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement