Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
wp-rocket
/
inc
/
Engine
/
Optimization
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php declare(strict_types=1); namespace WP_Rocket\Engine\Optimization; trait RegexTrait { /** * Finds nodes matching the pattern in the HTML. * * @param string $pattern Pattern to match. * @param string $html HTML content. * @param string $modifiers Regex modifiers. * * @return array */ protected function find( string $pattern, string $html, string $modifiers = 'Umsi' ) { preg_match_all( '/' . $pattern . '/' . $modifiers, $html, $matches, PREG_SET_ORDER ); if ( empty( $matches ) ) { return []; } return $matches; } }