import re


def parse_checksum_row(row):
    """ Args:
            row: a line of text from pt-table-checksum

        Returns: An array of elements, if the regex matches
            [ts, errors, diffs, rows, chunks, chunks_skipped,
             elapsed_time, db, tbl]

        Ex: [ '08-30T06:25:33', '0', '0', '28598', '60', '0', '0.547',
              'pbdata04159', 'userstats' ]

        If the regex doesn't match, return nothing.
    """

    p = re.compile(''.join("^(\d+-\d+T\d+:\d+:\d+)\s+(\d+)\s+(\d+)\s+"
                           "(\d+)\s+(\d+)\s+(\d+)\s+(\d+\.\d+)\s+"
                           "(.+?)\.(.+)$"))
    m = p.match(row)
    if m:
        return m.groups()