Posts

Showing posts with the label alphanumeric

Python Regex : Match Only Alpha Numeric,hyphen and white space

Image
Clash Royale CLAN TAG #URR8PPP Python Regex : Match Only Alpha Numeric,hyphen and white space Though there are several topics similar, i couldn't arrive to a solution. Hence creating a new question I have a flat file saved in utf-8 format, which i try to parse and read data.I need to ignore all unicode characters from the string and include only alpha numeric ,hyphen and white space.Below is the regex i use formatted_text= re.sub('[^a-zA-Z0-9s-]','',original_string) But this does not remove the Unicode characters. If i remove s from the regex pattern it ignores uni codes but also the white space. Here is the screen shot of data.Since i couldn't copy it in the same format i am attaching the screen shot Screen Shot Please, don't post images with text. Edit your question and put the data in text format. – Andrej Kesely 25 mins ago ...