public function whenAssetIs($pattern)
    {
        return $this->when(function($asset) use ($pattern)
        {
            return (bool) preg_match('#'.$pattern.'#', $asset->getRelativePath());
        });
    }
public function whenAssetIs($pattern)
    {
        return $this->when(function($asset) use ($pattern)
        {
            return (bool) preg_match('#'.$pattern.'#', $asset->getRelativePath());
        });
    }
public function whenAssetIs ( $ pattern ) { return $ this -> when ( function ( $ asset ) use ( $ pattern ) { return ( bool ) preg_match ( '#' . $ pattern . '#' , $ asset -> getRelativePath ( ) ) ; } ) ; }
Add a asset name pattern requirement to the filter.

@param  string  $pattern
@return \Basset\Filter\Filter
Add a asset name pattern requirement to the filter .