28
rated 0 times
[
35]
[
7]
/ answers: 1 / hits: 10775
/ 11 Years ago, fri, january 31, 2014, 12:00:00
I have following url:
https://www.example.com/article/f/1/test+article
And I need to get 1 part from the url via JavaScript (pure javascript). I know that I can get it with location.pathname.replace() but I'm not good with regex.
UPDATE
Just for clarification: https://www.example.com/article/f/ never changes, it's constant. The only part of the url that can change is 1 (article id) and test article (article name). And I want to catch the article id.
More From » regex