import re


def version_compare(version_a, version_b):
    """
    Compare two versions given as strings, taken from `here`_.
    
    .. _here: http://stackoverflow.com/questions/1714027/version-number-comparison
    
    :param version_a: version a
    :type version_a: string
    :param version_b: version b
    :type version_b: string
    :return: 0 if versions are equivalent, < 0 if version_a is lower than version_b
        , > 0 if version_b is lower than version_b
    """
    def normalize(v):
        return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]

    # for python 3.x
    def cmp(a, b):
      return (a > b) - (a < b)
       
    return cmp(normalize(version_a), normalize(version_b))