function HTMLRestrictions::getRegExForWildCardAttributeName

Same name in other branches
  1. 9 core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::getRegExForWildCardAttributeName()
  2. 11.x core/modules/ckeditor5/src/HTMLRestrictions.php \Drupal\ckeditor5\HTMLRestrictions::getRegExForWildCardAttributeName()

Computes a regular expression for matching a wildcard attribute name.

Parameters

string $wildcard_attribute_name: The wildcard attribute name for which to compute a regular expression.

Return value

string The computed regular expression.

4 calls to HTMLRestrictions::getRegExForWildCardAttributeName()
HTMLRestrictions::doDiff in core/modules/ckeditor5/src/HTMLRestrictions.php
Computes difference of two HTML restrictions, without wildcard support.
HTMLRestrictions::doIntersect in core/modules/ckeditor5/src/HTMLRestrictions.php
Computes intersection of two HTML restrictions, without wildcard support.
HTMLRestrictions::merge in core/modules/ckeditor5/src/HTMLRestrictions.php
Computes set union of two HTML restrictions, with wildcard support.
HTMLRestrictions::toGeneralHtmlSupportConfig in core/modules/ckeditor5/src/HTMLRestrictions.php
Transforms into the CKEditor 5 GHS configuration representation.

File

core/modules/ckeditor5/src/HTMLRestrictions.php, line 1055

Class

HTMLRestrictions
Represents a set of HTML restrictions.

Namespace

Drupal\ckeditor5

Code

private static function getRegExForWildCardAttributeName(string $wildcard_attribute_name) : string {
    assert(self::isWildcardAttributeName($wildcard_attribute_name));
    return '/^' . str_replace('*', '.*', $wildcard_attribute_name) . '$/';
}

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