Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::removeSelectorComponentsprivateWC 1.0

Removes components from a CSS selector, replacing them with "*" if necessary.

Method of the class: CssInliner{}

No Hooks.

Returns

String . selector which will match the relevant DOM elements if the removed components are assumed to apply (or in the case of pseudo-elements will match their originating element)

Usage

// private - for code of main (parent) class only
$result = $this->removeSelectorComponents( $matcher, $selector ): string;
$matcher(string) (required)
regular expression part to match the components to remove.
$selector(string) (required)
.

CssInliner::removeSelectorComponents() code WC 10.8.1

private function removeSelectorComponents(string $matcher, string $selector): string
{
    return (new Preg())->throwExceptions($this->debug)->replace(
        ['/([\\s>+~]|^)' . $matcher . '/i', '/' . $matcher . '/i'],
        ['$1*', ''],
        $selector
    );
}