I have a url and I am trying to parse a string from it.
https://www.example.com/files/filename1/whop-die-do/434ssdf/rewth
The url will always be: https://www.example.com/files
The string I am trying to find is: filename1/whop-die-do
So other examples would look like this:
https://www.example.com/files/filename2/apples/asdfasdf/reasdfasdfth
\---> filename2/apples
https://www.example.com/files/bloop/oranges_r_great/zcvr/asdfasd
\---> bloop/oranges_r_great
https://www.example.com/files/name4/Wowzers123/as4t/532sadf
\---> name4/Wowzers123
This is the current regex pattern I am using /filename2\/([^/]+)/
(courtesy of @Wiktor)
This works only if the it contains filename2
within the string. Is it possible to have it automatically match after the: https://etcetc