code: public static function packageNameToRegexp($whiteListedPattern, $wrap = '{^%s$}i')
      {
          $cleanedWhiteListedPattern = str_replace('\\*', '.*', preg_quote($whiteListedPattern));
  
          return sprintf($wrap, $cleanedWhiteListedPattern);
      }
docs: 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