def get_previous_prompts(self, device):
        """Return the list of intermediate prompts. All except target."""
        device_index = self.devices.index(device)
        prompts = [re.compile("(?!x)x")] + \
                  [dev.prompt_re for dev in self.devices[:device_index] if dev.prompt_re is not None]
        return prompts