(appversion_text)
return _first_group_match(appversion_text, patterns)
>>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.11.0"(29272). App v65. '
    ...     'CommCare Version 2.11. Build 29272, built on: February-14-2014'
    ... )
    '2.11.0'
    >>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.4.1"(10083). App v19.'
    ...     'CommCare Version 2.4. Build 10083, built on: March-12-2013'
    ... )
    '2.4.1'
    >>> get_commcare_version_from_appversion_text(u'संस्करण "2.27.8" (414593)')
    '2.27.8'
    >>> get_commcare_version_from_appversion_text(u'CommCare Android, आवृत्ती" 2.44.5"(452680). ॲप वि.29635 कॉमर्स आवृत्ती2.44. बिल्ड452680, रोजी तयार केले:2019-01-17')
    '2.44.3'
>>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.11.0"(29272). App v65. '
    ...     'CommCare Version 2.11. Build 29272, built on: February-14-2014'
    ... )
    '2.11.0'
    >>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.4.1"(10083). App v19.'
    ...     'CommCare Version 2.4. Build 10083, built on: March-12-2013'
    ... )
    '2.4.1'
    >>> get_commcare_version_from_appversion_text(u'संस्करण "2.27.8" (414593)')
    '2.27.8'
    >>> get_commcare_version_from_appversion_text(u'CommCare Android, आवृत्ती" 2.44.5"(452680). ॲप वि.29635 कॉमर्स आवृत्ती2.44. बिल्ड452680, रोजी तयार केले:2019-01-17')
    '2.44.3'
>>> get_commcare_version_from_appversion_text ( ... CommCare ODK version 2 . 11 . 0 ( 29272 ) . App v65 . ... CommCare Version 2 . 11 . Build 29272 built on : February - 14 - 2014 ... ) 2 . 11 . 0 >>> get_commcare_version_from_appversion_text ( ... CommCare ODK version 2 . 4 . 1 ( 10083 ) . App v19 . ... CommCare Version 2 . 4 . Build 10083 built on : March - 12 - 2013 ... ) 2 . 4 . 1 >>> get_commcare_version_from_appversion_text ( u संस्करण 2 . 27 . 8 ( 414593 ) ) 2 . 27 . 8 >>> get_commcare_version_from_appversion_text ( u CommCare Android आवृत्ती 2 . 44 . 5 ( 452680 ) . ॲप वि . 29635 कॉमर्स आवृत्ती2 . 44 . बिल्ड452680 रोजी तयार केले : 2019 - 01 - 17 ) 2 . 44 . 3
def get_commcare_version_from_appversion_text(appversion_text):
    """
    >>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.11.0"(29272). App v65. '
    ...     'CommCare Version 2.11. Build 29272, built on: February-14-2014'
    ... )
    '2.11.0'
    >>> get_commcare_version_from_appversion_text(
    ...     'CommCare ODK, version "2.4.1"(10083). App v19.'
    ...     'CommCare Version 2.4. Build 10083, built on: March-12-2013'
    ... )
    '2.4.1'
    >>> get_commcare_version_from_appversion_text(u'संस्करण "2.27.8" (414593)')
    '2.27.8'
    >>> get_commcare_version_from_appversion_text(u'CommCare Android, आवृत्ती" 2.44.5"(452680). ॲप वि.29635 कॉमर्स आवृत्ती2.44. बिल्ड452680, रोजी तयार केले:2019-01-17')
    '2.44.3'
    """
    patterns = [
        r'version "([\d.]+)"',
        r'"([\d.]+)"\s+\(\d+\)',
        r'"\s*([\d.]+)\s*"',
    ]
    return _first_group_match(appversion_text, patterns)
def get_commcare_version_from_appversion_text ( appversion_text ) : patterns = [ r'version "([\d.]+)"' , r'"([\d.]+)"\s+\(\d+\)' , r'"\s*([\d.]+)\s*"' , ] return _first_group_match ( appversion_text , patterns )