<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _extract_version(version_string, pattern):
 """ Extract the version from `version_string` using `pattern`. Return the version as a string, with leading/trailing whitespace stripped. """

    if version_string:
        match = pattern.match(version_string.strip())
        if match:
            return match.group(1)
    return ""