'Reads output until any of the ``expected`` regular expressions match.
This keyword accepts any number of regular expressions patterns or
compiled Python regular expression objects as arguments. Text up to
and including the first match to any of the regular expressions is
returned and logged. If no match is found, this keyword fails. How much
to wait for the output depends on the [#Configuration|configured timeout].
If the last given argument is a [#Logging|valid log level], it is used
as ``loglevel`` similarly as with `Read Until` keyword.
See the documentation of
[http://docs.python.org/2/library/re.html|Python re module]
for more information about the supported regular expression syntax.
Notice that possible backslashes need to be escaped in Robot Framework
test data.
Examples:
| `Read Until Regexp` | (#|$) |
| `Read Until Regexp` | first_regexp | second_regexp |
| `Read Until Regexp` | \\d{4}-\\d{2}-\\d{2} | DEBUG |'

def read_until_regexp(self, *expected):

    if (not expected):
        raise RuntimeError('At    least    one    pattern    required')
    if self._is_valid_log_level(expected[(-1)]):
        loglevel = expected[(-1)]
        expected = expected[:(-1)]
    else:
        loglevel = None
    (success, output) = self._read_until_regexp(*expected)
    self._log(output, loglevel)
    if (not success):
        expected = [(exp if is_string(exp) else exp.pattern) for exp in expected]
        raise NoMatchError(expected, self._timeout, output)
    return output
