Load images with substring in filename from a given path
Regular expression example.

For the most part this is a generic python question, some answers from stack overflow.

python finding substring inside string

Python glob multiple extensions

Python glob multiple filetypes

For blender specifics, the image file extensions that your blender can open are 

&gt;&gt;&gt; bpy.path.extensions_image
frozenset({'.dpx', '.pdd', '.jp2', '.hdr', '.j2c', '.rgb', '.tiff', '.sgi', '.tga', '.rgba', '.png', '.cin', '.jpg', '.exr', '.tif', '.dds', '.psd', '.psb', '.bmp', '.jpeg', '.tx'})


Here is a sample method, that searches for image files that have a substring in their name and an extension suitable to blender. A regular expression search is used in both cases. The searches are case insensitive.

The links above show how to do this using other tools such as glob, pathlib and fnmatch

import bpy

def find_files(substring, path='.', extensions=[]):
    from os import listdir
    from re import search, IGNORECASE
    return [f for f in listdir(path) 
            if search(r'%s' % substring, f, IGNORECASE) 
            and any(search(r'%s$' % ext, f, IGNORECASE) 
                    for ext in extensions)]

def image_files(substring, path="."):
    return find_files(substring, path=path, extensions=bpy.path.extensions_image)

def movie_files(substring, path="."):
    return find_files(substring, path=path, extensions=bpy.path.extensions_movie)

def audio_files(substring, path="."):
    return find_files(substring, path=path, extensions=bpy.path.extensions_audio)

# test call, search for "screenshot" in image folder 
# and load images 
from os.path import join
image_path = "/home/batfinger/Pictures"
for fp in image_files("screenshot", path=image_path):
    print(fp)
    bpy.data.images.load(join(image_path, fp))


Notes maybe switch extension search to first. For recursive folder search would use something like os.walk instead of os.listdir