AspireCloud/app/Utils/Patterns.php
2025-10-25 13:15:51 -06:00

18 lines
567 B
PHP

<?php
declare(strict_types=1);
namespace App\Utils;
class Patterns
{
// overly strict, requires versions to have only 2 or 3 parts
// public const SEMANTIC_VERSION = '/^v?(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/';
// looser and has named groups, but still not actually used anywhere
public const SEMANTIC_VERSION = '/^v?(?<major>\d+)(?\.(?<minor>\d+))?(?:\.(?<patch>\d+))?(?<extra>[-.\w]*)$/';
private function __construct()
{
// not instantiable
}
}