I have a URL and need to extract a specific value from it by removing a certain step. I am looking for a regex solution to accomplish this task
For example, if I have the window.location.href
, the URL might look like this:
https://mypage/route/step-1/more-route/
https://mypage/route/step-5/more-route/
I am seeking advice on how to use regex to extract the step value from these URLs. Any suggestions would be appreciated.
Thank you!