Banja Lab / Benchmarks / Test
The same task, run on 28 models. Compare the outputs side by side, or open any one in a popup to inspect it.
Top result: claude-opus-4-8 (low reasoning) at 100.0% composite. Lowest: claude-opus-4-8 at 0.0%. 28 models compared on this task.
Implement a Python function `parse_semver(s)` that parses a Semantic Versioning 2.0.0 version string and returns a dict, or returns None if the string is not a valid SemVer version. A valid version is `MAJOR.MINOR.PATCH` followed by an optional `-prerelease` and an optional `+build` metadata section, in that order. Rules: - MAJOR, MINOR and PATCH are each a non-negative integer with no leading zeros (so "0" is allowed, "01" is not). - The optional prerelease starts with "-" and is a dot-separated list of one or more identifiers. A numeric identifier must not have leading zeros. Identifiers are made of [0-9A-Za-z-]. - The optional build metadata starts with "+" and is a dot-separated list of one or more identifiers made of [0-9A-Za-z-] (leading zeros allowed here). On success return a dict with keys: - "major", "minor", "patch": the three integers, - "prerelease": the prerelease string without the leading "-", or None, - "build": the build string without the leading "+", or None. Return None for any input that does not match (including non-strings). Use only the Python standard library. Write your solution to `solution.py`.