src/Composer/Package/BasePackage.php
public static function packageNameToRegexp($whiteListedPattern, $wrap = '{^%s$}i')
    {
        $cleanedWhiteListedPattern = str_replace('\\*', '.*', preg_quote($whiteListedPattern));

        return sprintf($wrap, $cleanedWhiteListedPattern);
    }
public static function packageNameToRegexp($whiteListedPattern, $wrap = '{^%s$}i')
    {
        $cleanedWhiteListedPattern = str_replace('\\*', '.*', preg_quote($whiteListedPattern));

        return sprintf($wrap, $cleanedWhiteListedPattern);
    }
public static function packageNameToRegexp ( $ whiteListedPattern , $ wrap = '{^%s$}i' ) { $ cleanedWhiteListedPattern = str_replace ( '\\*' , '.*' , preg_quote ( $ whiteListedPattern ) ) ; return sprintf ( $ wrap , $ cleanedWhiteListedPattern ) ; }
Build a regexp from a package name, expanding * globs as required

@param  string $whiteListedPattern
@param  bool $wrap Wrap the cleaned string by the given string
@return string
Build a regexp from a package name expanding * globs as required