This page demonstrates how to use the Attachment Table macro, which is part of the Advanced Tables for Confluence add-on, to select attachments based on the Space or attachment name, using a Regex expression.
Use the special @self value for the spaceRegex parameter to match on all attachments in the current Space.
Use .*png|.*jpg to match on attachments whose name ends in png or jpg.