I have this PHP regular Expression:
https?://(?:[a-z0-9]+\.)?livestream\.com/(?:(accounts/[0-9]+/events/[0-9]+(?:/videos/[0-9]+)?)|[^\s/]+/video\?clipId=([^\s&]+)|([^\s/]+))
I like to match the following URLs with the the results.
http://original.livestream.com/bethanychurchnh = bethanychurchnh
http://original.livestream.com/bethanychurchnh/video?clipId=flv_b54a694b-043c-4886-9f35-03c8008c23 = flv_b54a694b-043c-4886-9f35-03c8008c23
http://livestream.com/accounts/142499/events/3959775 = accounts/142499/events/3959775
http://livestream.com/accounts/142499/events/3959775/videos/83958146 = /accounts/142499/events/3959775/videos/83958146
It works fine but I have this problem that the capture groups are 2nd and 3rd for some of the matches. I like to have the captured string always be matched as the first capture group. Is this possible?