is_strict#
Test whether a string is a strict version suitable for CPAN indexing.
Synopsis#
version::is_strict($str);
version->is_strict($str);
Strict versions rule out alpha underscores and unusual shapes. A
decimal version must be a single dot between two digit runs; a
dotted-integer version must start with v and have at least three
components. This is the form PAUSE expects for permanent releases.
What you get back#
A boolean: 1 if the string matches the strict grammar, the empty
string otherwise.
Examples#
version::is_strict("1.02"); # 1
version::is_strict("v1.2.3"); # 1
version::is_strict("1.2.3"); # "" — needs the v prefix
version::is_strict("1.02_03"); # "" — underscores disallowed
version::is_strict("v1.2"); # "" — needs 3+ components
Differences from upstream#
Fully compatible with upstream version 0.9929.
See also#
is_lax— the permissive counterpartdeclare— the recommended way to produce a strict dotted-integer