I have a RegEx originally like this:
/https://medal.tv/gameseuro-truck-sim-2/clips/([A-z0-9-]+)(/[A-z0-9]+)?(??[A-z0-9]+=?[A-z0-9]+-[A-z0-9]+)?/
which works perfectly, however, I would like it to work both when it is "euro-truck-sim-2" and "imported-clips". I have not too much (practically, zero) experience with RegEx and I have no clue what I am doing wrong. This is what I tried and I don’t know if the RegEx or something else is broken with the code itself.
/https://medal.tv/games/(imported-clips|euro-truck-sim-2+)?/clips/([A-z0-9-]+)(/[A-z0-9]+)?(??[A-z0-9]+=?[A-z0-9]+-[A-z0-9]+)?/
What I see is that after the imported-clips match, there is nothing else after that in my link:
https://medal.tv/clips/imported-clips
Expected behavior should be:
https://medal.tv/games/imported-clips/clips/remglmZK54/egmkr4t
or
https://medal.tv/games/euro-truck-sim-2/clips/remglmZK54/egmkr4t
changed into
https://medal.tv/clips/remglmZK54
2
Answers
Found the solution:
prints