StageBase::COMPOSER_PACKAGE_REGEX

The regular expression to check if a package name is a regular package.

If you try to require an invalid package name, this is the regular expression that Composer will, at the command line, tell you to match.

See also

\Composer\Package\Loader\ValidatingArrayLoader::hasPackageNamingError()

::validateRequirements()

File

core/modules/package_manager/src/StageBase.php, line 143

Class

StageBase
Creates and manages a stage directory in which to install or update code.

Namespace

Drupal\package_manager

Code

private const COMPOSER_PACKAGE_REGEX = '/^[a-z0-9]([_.-]?[a-z0-9]+)*\\/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$/';

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.