Parses the supplied output and returns the version string.

    :param output: A string containing the output of running snort.
    :returns: Version string for the version of snort run. None if not found.

def parse_version(output):
    """
    Parses the supplied output and returns the version string.

    :param output: A string containing the output of running snort.
    :returns: Version string for the version of snort run. None if not found.
    """
    for x in output.splitlines():
        match = VERSION_PATTERN.match(x)
        if match:
            return match.group('version').strip()
    return None