def parse_rc(bazel_version):
    """Parse the version string of the given Bazel RC version

    Args:
        bazel_version: The Bazel version string.

    Returns:
        The integer RC number if the given bazel version was a RC version or None.
    """
    if bazel_version.find("rc") != -1:
        rc = ""
        for i in range(len(bazel_version) - bazel_version.find("rc") - 2):
            c = bazel_version[i + bazel_version.find("rc") + 2]
            if not c.isdigit():
                if rc == "":
                    return -1
                break
            rc += c
        return int(rc)
    return None