Multiple image attachments and file types need to be accepted in the form so I used this regex to validate the attachments:
regex(.,'^(?:[0-9a-zA-Z\._-]+\.(?:png|PNG|gif|GIF|jp[e]?g|JP[E]?G),*)+$').
It was interesting to discover the Survey123 field app renames and formats attachments into a string like this:
media-20220209-044727.jpg,media-20220209-174736.png,media-20220209-044727.gif
The web form doesn't rename files so the string looks more like this:
IMG_4EE7E891D341-1.jpeg,Screen_Shot.png
Best,
Gerhard