code: def has_special_char(p_str, check_style=charChinese):
      
      if check_style == charChinese:
          check_pattern = re.compile(u'[\u4e00-\u9fa5]+')
      elif check_style == charNum:
          check_pattern = re.compile(u'[0-9]+')
      else:
          return False
      
      try:
          if check_pattern.search(p_str):
              return True
          else:
              return False
      except TypeError as ex:
          raise TypeError(str(ex))
docs: 检查字符串是否含有指定类型字符
  
      :param:
          * p_str: (string) 需要判断的字符串
          * check_style: (string) 需要判断的字符类型，默认为 charChinese (编码仅支持utf-8), 支持 charNum，该参数向后兼容
  
      :return:
          * True 含有指定类型字符
          * False 不含有指定类型字符
  
      举例如下::
  
          print('--- has_special_char demo ---')
          p_str1 = 'meiyouzhongwen'
          non_chinese_result = has_special_char(p_str1, check_style=charChinese)
          print(non_chinese_result)
  
          p_str2 = u'有zhongwen'
          chinese_result = has_special_char(p_str2, check_style=charChinese)
          print(chinese_result)
  
          p_str3 = 'nonnumberstring'
          non_number_result = has_special_char(p_str3, check_style=charNum)
          print(non_number_result)
  
          p_str4 = 'number123'
          number_result = has_special_char(p_str4, check_style=charNum)
          print(number_result)
          print('---')
  
      执行结果::
  
          --- has_special_char demo ---
          False
          True
          False
          True
          ---