def search(self, name):
        """ 搜尋股票名稱 by unicode

            :param str name: 欲搜尋的字串
            :rtype: dict
        """
        pattern = re.compile(name)
        result = {}
        for i in self.__allstockno:
            query = re.search(pattern, self.__allstockno[i])
            if query:
                query.group()
                result[i] = self.__allstockno[i]
        return result
def search ( self , name ) : pattern = re . compile ( name ) result = { } for i in self . __allstockno : query = re . search ( pattern , self . __allstockno [ i ] ) if query : query . group ( ) result [ i ] = self . __allstockno [ i ] return result
搜尋股票名稱 by unicode

            :param str name: 欲搜尋的字串
            :rtype: dict