code: public static String getSearchFilePattern(final String... fileExtensions)
  	{
  		if (fileExtensions.length == 0)
  		{
  			return "";
  		}
  		final String searchFilePatternPrefix = "([^\\s]+(\\.(?i)(";
  		final String searchFilePatternSuffix = "))$)";
  		final StringBuilder sb = new StringBuilder();
  		int count = 1;
  		for (final String fileExtension : fileExtensions)
  		{
  			if (count < fileExtensions.length)
  			{
  				sb.append(fileExtension).append("|");
  			}
  			else
  			{
  				sb.append(fileExtension);
  			}
  			count++;
  		}
  		return searchFilePatternPrefix + sb.toString().trim() + searchFilePatternSuffix;
  	}
docs: Gets a regex search file pattern that can be used for searching files with a Matcher.
  
  @param fileExtensions
  The file extensions that shell exist in the search pattern.
  @return a regex search file pattern that can be used for searching files with a Matcher.