Yup, it'll work.  Look at this code snippet, this is how it parses for the version.  As long as the regex matches the string, you can choose whichever match you want


        p = subprocess.Popen(command.split(), stdout=subprocess.PIPE,stderr=subprocess.PIPE)
        versionOut,versionError = p.communicate()
        
        #Set what stdout_result and stderr_result are
        stdout_result=versionOut
        stderr_result=versionError
        
        versionOutCombined = str(versionOut)+str(versionError)
        
        #Find the version number in the output
        version_result = search(regex,versionOutCombined).group(int(line))