Test, validate and match regular expressions
Validates Semantic Versioning 2.0.0 strings, capturing Major, Minor, and Patch numbers (0 or digits without leading zeros) separated by dots. Optionally matches a pre-release tag after a hyphen (e.g. -alpha.1) and build metadata after a plus sign (e.g. +build.5), both composed of dot-separated alphanumeric identifiers. Anchored with ^ and $ so the entire string must be a valid version, making it useful for validating package versions, release tags, or dependency inputs.