Re: [BangPypers] Reg Expression problem and Unicode...

2009-05-27 Thread Sam's Lists
Anand--- Thanks, that worked great. -Sam On Tue, May 26, 2009 at 7:34 PM, Anand Chitipothu wrote: > > text = "The Price £7" > > pattern = u"£\d" > > > > m = re.search(pattern, text, re.UNICODE) > > print m.group(0) > > Your text is in utf-8 encoding and pattern in unicode. > Make text unicode s

Re: [BangPypers] Reg Expression problem and Unicode...

2009-05-26 Thread Anand Chitipothu
> text = "The Price £7" > pattern = u"£\d" > > m = re.search(pattern, text, re.UNICODE) > print m.group(0) Your text is in utf-8 encoding and pattern in unicode. Make text unicode solves the issue. text = u"The Price £7" pattern = u"£\d" m = re.search(pattern, text, re.UNICODE) print m.group(0).e

[BangPypers] Reg Expression problem and Unicode...

2009-05-26 Thread Sam's Lists
Hello everyone... I have a small problem...I'm trying to match a pound symbol in a document using Python. (Version 2.5.2, although I also ran this under 2.6 and it seemed to give the same result. But ultimately I need correct code for 2.5.2) Here's the code: #!/usr/bin/env python # -*- coding: