is_lax#

Test whether a string is acceptable to parse / new as a version.

Σύνοψη#

version::is_lax($str);
version->is_lax($str);

Accepts anything the constructor would accept: decimal, dotted-integer, v-string, with or without an underscore for alpha. Use it to validate user input before feeding it to parse.

Τι επιστρέφεται#

A boolean: 1 if the string parses as any valid version, the empty string otherwise.

Παραδείγματα#

version::is_lax("1.0203");     # 1
version::is_lax("v1.2.3");     # 1
version::is_lax("1.02_03");    # 1
version::is_lax("");           # ""
version::is_lax("abc");        # ""

Διαφορές από το upstream#

Fully compatible with upstream version 0.9929.

Δείτε επίσης#

  • is_strict - the tighter validator, used for CPAN-indexable versions

  • new - accepts the same set of strings