<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_gdb_version(line):
 r"""Parse the gdb version from the gdb header. From GNU coding standards: the version starts after the last space of the first line. 7.5.1 7.2.50.20100908 7.5.1 7.6 7.6.1 """

    if line.startswith('~"') and line.endswith(r'\n"'):
        version = line[2:-3].rsplit(' ', 1)
        if len(version) == 2:
            # Strip after first non digit or '.' character. Allow for linux
            # Suse non conformant implementation that encloses the version in
            # brackets.
            version = ''.join(takewhile(lambda x: x.isdigit() or x == '.',
                                                    version[1].lstrip('(')))
            return version.strip('.')
    return ''