I need help writing this regex. Maybe it's obvious to someone else, but I keep failing one while matching the other or vice versa.
In Ruby.
Here are the the three test cases that I need to meet.
[[https://example.com/photo.png]]
[[https://example.com/video.mp4 With a text caption that's always separated from the URL by at least one space.]]
[[https://example.com/photo.png]] [[https://example.com/photo.png]]
- Should match the URL.
- Should match the URL and caption.
- Should match the URL two separate times.
If you come up with something, send it my way. Thanks! Sb
Not pretty, but this works: