Is there a simple regular expression to match all unicode quotes? Or does one have to hand-code it like this:
quotes = ur"[\"'\u2018\u2019\u201c\u201d]"
Thank you for reading.
Brian
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python doesn’t support Unicode properties, therefore you can’t use the
PiandPfproperties, so I guess your solution is as good as it gets.You might also want to consider the “false quotation marks” that are sadly being used – the acute and grave accent (
´and “):\u0060and\u00B4`.Then there are guillemets (
« » ‹ ›), do you want those, too? Use\u00BB\u203A\u00AB\u2039for those.Also, your command has a little bug: you’re adding the backslash to the
quotesstring (because you’re using a raw string). Use a triple-quoted string instead.