M
marek
trying this example to make print MatchObject reference. Fails (prints None).
Does anybody know where I am wrong?
# -*- coding: cp1251 -*-
import re
# pattern in Ukrainian ('привіт')
p = '\377\376?\004@\0048\0042\004V\004B\004'
# data (pattern is in the middle of the string)
d = '\377\376t\000e\000s\000t\000?\004@\0048\0042\004V\004B\004t\000t\000'
re_test = re.compile(p, re.UNICODE)
print re_test.search(d, re.UNICODE)
Does anybody know where I am wrong?
# -*- coding: cp1251 -*-
import re
# pattern in Ukrainian ('привіт')
p = '\377\376?\004@\0048\0042\004V\004B\004'
# data (pattern is in the middle of the string)
d = '\377\376t\000e\000s\000t\000?\004@\0048\0042\004V\004B\004t\000t\000'
re_test = re.compile(p, re.UNICODE)
print re_test.search(d, re.UNICODE)