mod resolved_spec;
mod spec_error;
mod syntax;
mod syntax_parser;
mod syntax_traits;
mod unresolved_spec;
pub use resolved_spec::*;
pub use spec_error::*;
pub use syntax::*;
#[doc(hidden)]
pub use syntax_parser::*;
pub use syntax_traits::*;
pub use unresolved_spec::*;
use regex::Regex;
use std::sync::OnceLock;
pub fn is_calver_like(value: &str) -> bool {
static CALVER_REGEX: OnceLock<Regex> = OnceLock::new();
CALVER_REGEX
.get_or_init(|| {
Regex::new(
r"-?(v|V)?([0-9]{2,4})-((0?[1-9]{1})|10|11|12)(-(0?[1-9]{1}|[1-3]{1}[0-9]{1}))?-?",
)
.unwrap()
})
.is_match(value)
}
pub fn is_semver_like(value: &str) -> bool {
static SEMVER_REGEX: OnceLock<Regex> = OnceLock::new();
SEMVER_REGEX
.get_or_init(|| Regex::new(r"-?(v|V)?[0-9]+\.[0-9]+(\.[0-9]+)?-?").unwrap())
.is_match(value)
}