I don't understand this part of a long regex:
(?i)(jpg|jpeg|gif|png)(?-i)\z/
What are the parenthesis for again? Is it a capture group? What is the i flag in the capture group for?
I think the only parts I understand are the | and the \z at the end.