Parse the subsequent lines of a device array stanza in ``/proc/mdstat``
    for the "up" indictor string.

    Lines are expected to be like:

        129596288 blocks [2/2] [UU]

    or

        1318680576 blocks level 5, 1024k chunk, algorithm 2 [10/10] [UUU_UUUUUU]

    In particular, this method searchs for the string like ``[UU]`` which
    indicates whether component devices or up, ``U`` or down, ``_``.

    Parameters
    ----------

    line : str
        A single line from a device array stanza.

    Returns
    -------

        The string containing a series of ``U`` and ``\_`` characters if
        found in the string, and ``None`` if the uptime string is not found.

def parse_upstring(line):
    """
    Parse the subsequent lines of a device array stanza in ``/proc/mdstat``
    for the "up" indictor string.

    Lines are expected to be like:

        129596288 blocks [2/2] [UU]

    or

        1318680576 blocks level 5, 1024k chunk, algorithm 2 [10/10] [UUU_UUUUUU]

    In particular, this method searchs for the string like ``[UU]`` which
    indicates whether component devices or up, ``U`` or down, ``_``.

    Parameters
    ----------

    line : str
        A single line from a device array stanza.

    Returns
    -------

        The string containing a series of ``U`` and ``\_`` characters if
        found in the string, and ``None`` if the uptime string is not found.
    """
    UP_STRING_REGEX = r"\[(U|_)+]"

    match = re.search(UP_STRING_REGEX, line)
    if match:
        return match.group().strip('[]')
    else:
        return None