def search(self,q):
    """ Search. """
    import re
    pattern = re.compile("%s" % q)
    result = {}
    for i in self.allstockno:
      b = re.search(pattern, self.allstockno[i])
      try:
        b.group()
        result[i] = self.allstockno[i]
      except:
        pass

    return result