I have a URL from which I need to read a value. I need to take out the step from the URL. I want to write regex to do that
Let say that if I get the window.location.href
, I get the following result
https://mypage/route/step-1/more-route/
https://mypage/route/step-5/more-route/
I want to get the step using regex. What is the best way to achieve that?
Thanks