Benjamin Bakhshi
Benjamin Bakhshi

Reputation: 663

Matching Specific Filenames

I can't figure this exercise at RegexOne.come: http://regexone.com/example/4?

This was my solution: (^.*\.(jpg|png|gif)$)

The capture text shows up green, but my result is all green checks except for the 3 that I need.

I tried this too: (^.*(\.jpg|\.png|\.gif)$)

Upvotes: 0

Views: 238

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21507

Try this:

(^.*)\.(jpg|png|gif)$

Upvotes: 1

Related Questions