[Tutor] unicode support in 're'

Parth Malwankar parth.malwankar@wipro.com
Mon, 16 Apr 2001 11:41:24 +0530


Hello,

I wish to find the occurance of a pattern in a unicode text file.
I tried using re for this purpose.
#####
	expr = re.compile(u'^\.', re.UNICODE|re.M)
	x = expr.split(textfromfile)
#####
but this doesnt seem to split on the character specified. Am I doing something wrong.
It is possible to convert the read lines into ascii and then run the match. But I was wondering if there is any direct way to do this.

Thanks in advance,
Parth