1234567891011121314151617181920212223 |
- # -*- coding:utf-8 -*-
- import re
- def IsChineseCharInside(sentence):
- for uchar in sentence:
- if uchar >= u'\u4e00' and uchar<=u'\u9fa5':
- return True
- return False
- def isMatchRegExp(param,rule):
- if param == None or param == "":
- return True
- isRegular = False
- try:
- for word in param:
- matchObj = re.search(word,rule, re.M | re.I | re.S)
- if matchObj:
- isRegular = True
- else:
- return False
- return isRegular
- except Exception as err:
- return False
|