[Tutor] Stuck: unicode in regular expressions
Ron Phillips
RPhillips at engineer.co.summit.oh.us
Tue Aug 9 16:45:31 CEST 2005
I am expecting users to cut-and-paste DMS data into an application * like: +40 30 15 E40 15 34.56, -81 0 0, 81 57 34.27E, W 40° 13' 27.343", 40° 13' 27.343" S, 140° 13' 27.343"S, S40° 13' 27.34454, 81:57:34.27E
I've been able to write a regex that seems to work in redemo.py, but it doesn't do at all what I want when I try to code it using the re module. The problem seems to be the way I am using unicode * specifically all those punctuation marks that might get pasted in. I anticipate the program getting its input from a browser; maybe that will narrow down the range somewhat.
Anyway, given the string above, what regex will match the " and ' characters, please? I have tried \x02BC and \x92 and \x2019 for the ' , but no result. I am sure it's simple; I am sure some other newbie has asked it, but I have Googled my brains out, and can't find it.
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050809/a7924361/attachment.htm
More information about the Tutor
mailing list