src/ETSGlobalCodingStandard/Helpers/WildcardHelper.php
/**
     * Searches for a "glob" pattern in a string.
     *
     * @param string $pattern The "glob" pattern
     * @param string $subject The string to search from
     *
     * @return bool True if the pattern was found in the subject string, false otherwise.
     */
Searches for a "glob" pattern in a string.
@param string $pattern The "glob" pattern
@param string $subject The string to search from

@return bool True if the pattern was found in the subject string, false otherwise.
Searches for a " glob " pattern in a string . @param string $pattern The " glob " pattern @param string $subject The string to search from @return bool True if the pattern was found in the subject string false otherwise .
public static function match(string $pattern, string $subject): bool
    {
        $regexp = '#^' . str_replace(['\\', '*'], ['\\\\', '(.*)'], $pattern) . '$#';
        return preg_match($regexp, $subject) === 1;
    }
public static function match ( string $ pattern , string $ subject ) : bool { $ regexp = '#^' . str_replace ( [ '\\' , '*' ] , [ '\\\\' , '(.*)' ] , $ pattern ) . '$#' ; return preg_match ( $ regexp , $ subject ) === 1 ; }
Searches for a "glob" pattern in a string.
Searches for a " glob " pattern in a string .
// Escape backslashes, replace '*' by regexp wildcard (.*)