is_semver: Check if an argument is a semantic versioning string

View source: R/string.R

is_semverR Documentation

Check if an argument is a semantic versioning string

Description

Validates semantic versioning 2.0.0 format, including optional pre-release and build metadata. Uses the official recommended regex from https://semver.org/.

Usage

is_semver(x)

Arguments

x

(any)
Object to check.

Value

TRUE if x is a valid semver string, FALSE otherwise.

References

https://semver.org/

Examples

is_semver("1.0.0")

checkstring documentation built on Sept. 28, 2026, 5:07 p.m.