public List<ClasspathResource> findByRegex(String search) {
        List<ClasspathResource> allResources = findAllClasspathResources();
        List<ClasspathResource> matches = new ArrayList<>();
        Pattern pattern = Pattern.compile(search);

        for (ClasspathResource resource : allResources) {
            if (resource != null && resource.getName() != null
                    && pattern.matcher(resource.getName()).find()) {
                matches.add(resource);
            }
        }
        return matches;
    }
public List < ClasspathResource > findByRegex ( String search ) { List < ClasspathResource > allResources = findAllClasspathResources ( ) ; List < ClasspathResource > matches = new ArrayList < > ( ) ; Pattern pattern = Pattern . compile ( search ) ; for ( ClasspathResource resource : allResources ) { if ( resource != null && resource . getName ( ) != null && pattern . matcher ( resource . getName ( ) ) . find ( ) ) { matches . add ( resource ) ; } } return matches ; }
finds a resource on the classpath using a regular expression.

@param search - search regular expression
@return - the list of classpath resources that match the regular expression