I am looking to find all images by Kawahara Keiga from Wikimedia.
The filenames usually contain the strings "RMNH.ART" and "Kawahara Keiga" - see:
https://en.wikipedia.org/wiki/File:Naturalis_Biodiversity_Center_-_RMNH.ART.5_-_Carcinoplax_longimana_(De_Haan,_1833)_-_Kawahara_Keiga.jpg
https://en.wikipedia.org/wiki/File:Naturalis_Biodiversity_Center_-_RMNH.ART.537_-_Halieutaea_stellata_-_Kawahara_Keiga_-_Siebold_Collection.jpg
https://en.wikipedia.org/wiki/File:Naturalis_Biodiversity_Center_-_RMNH.ART.256_-_Hemitrygon_akajei_(M%C3%BCller_%26_Henle,_1841)_-_Kawahara_Keiga_-_Siebold_Collection.jpg
Is it possible to query a Wikimedia API and get a list of files filtered by "contains" or a regex or similar?
Answering your specific question, you can use: https://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=RMNH.ART&srnamespace=6&srlimit=500&format=json
Alternatively though, since the images are categorised already, you could use this instead: https://commons.wikimedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Kawahara_Collection_at_Naturalis_Biodiversity_Center&cmlimit=500&format=json
These will both return the first 500 files, and to get all of them, you will need to add &sroffset=500 or &cmcontinue. Admittedly, I've not quite sure how the second one works.
The docs for both of these are at https://www.mediawiki.org/wiki/API:Search and https://www.mediawiki.org/wiki/API:Categorymembers