def is_version_string(string):
    """
    Check if a string is version string like 3.0.4-7 or 4.0.37-dev.
    Only digits are allowed for version part.
    Non-digits are allowed for the revision part, like 4.0.37-dev.
    """
    if not string:
        return False
    tokens = string.split("-")
    if len(tokens) > 2 or (len(tokens) == 2 and len(tokens[1]) > 10):
        return False
    versions = tokens[0].split(".")
    if len(versions) > 4:
        return False
    for ver in versions:
        if not ver.isdigit():
            return False
    return True