src/Shared/Globbing/GlobbingTrait.php
protected function nameGlobbing(
        /*# string */ $exactName,
        /*# string */ $name
    )/*# : bool */ {
        if ($name === $exactName) {
            return true;
        } elseif (false !== strpos($name, '*')) {
            $pat = str_replace(array('.', '*'), array('[.]', '[^.]*+'), $name);
            // last '*' should be different
            $pat = substr($pat, -6) != '[^.]*+' ? $pat : (substr($pat, 0, -6) . '.*+');
            return (bool) preg_match('~^' . $pat . '$~', $exactName);
        } else {
            return false;
        }
    }
protected function nameGlobbing(
        /*# string */ $exactName,
        /*# string */ $name
    )/*# : bool */ {
        if ($name === $exactName) {
            return true;
        } elseif (false !== strpos($name, '*')) {
            $pat = str_replace(array('.', '*'), array('[.]', '[^.]*+'), $name);
            // last '*' should be different
            $pat = substr($pat, -6) != '[^.]*+' ? $pat : (substr($pat, 0, -6) . '.*+');
            return (bool) preg_match('~^' . $pat . '$~', $exactName);
        } else {
            return false;
        }
    }
protected function nameGlobbing ( /*# string */ $ exactName , /*# string */ $ name ) /*# : bool */ { if ( $ name === $ exactName ) { return true ; } elseif ( false !== strpos ( $ name , '*' ) ) { $ pat = str_replace ( array ( '.' , '*' ) , array ( '[.]' , '[^.]*+' ) , $ name ) ; // last '*' should be different $ pat = substr ( $ pat , - 6 ) != '[^.]*+' ? $ pat : ( substr ( $ pat , 0 , - 6 ) . '.*+' ) ; return ( bool ) preg_match ( '~^' . $ pat . '$~' , $ exactName ) ; } else { return false ; } }
Check to see if $name matches with $exactName

e.g.
```php
// true
$this->nameGlobbing('user.*', 'user.login');

// true
$this->nameGlobbing('*', 'user.login');

// false
$this->nameGLobbing('blog.*', 'user.login');
```

@param  string $exactName
@param  string $name
@return bool
@access protected
Check to see if $name matches with $exactName