code: async def search(self, regex):
          
          coro = self._loop.run_in_executor(None, self._search, regex)
          match = await coro
  
          return match
docs: Wraps the search for a match in an `executor`_ and awaits for it.
  
          .. _executor: https://docs.python.org/3/library/asyncio-eventloop.html#executor