function HTMLRestrictions::getRegExForWildCardAttributeName

Same name and namespace in other branches
  1. 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.

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.