isSemVer function

bool isSemVer(
  1. String str
)

Checks if the string is a valid Semantic Version (SemVer).

Follows the official Semantic Versioning 2.0.0 specification, including optional pre-release and build metadata.

Example:

isSemVer('1.0.0'); // true
isSemVer('2.1.0-alpha.1'); // true
isSemVer('1.0.0+build.5'); // true
isSemVer('1.0'); // false

Implementation

bool isSemVer(String str) => _isSemVer(str);