#NodeAddress
# -*- coding: utf-8 -*-
import re
a='中国'
print a
print len(a)
print a
b=u'中国'
print len(b)
print type(b)
print b
# if a == b :
# print '111'
# else:
# print '222'
a='测试中国是否匹配'
b=u'中国'
c='中国'
if (re.search(b, a)):
print '222222'
else:
print '3333333'
if (re.search(c, a)):
print '4444444'
else:
print '5555555'
C:UsersAdministratorPycharmProjectsuntitledvenvScriptspython.exe C:/Users/Administrator/PycharmProjects/untitled/test.py
中国
6
中国
2
<type 'unicode'>
中国
3333333
4444444
Process finished with exit code 0