Extracting numbers from a url using javascript?
Posted
by stormist
on Stack Overflow
See other posts from Stack Overflow
or by stormist
Published on 2010-03-15T19:02:01Z
Indexed on
2010/03/15
19:09 UTC
Read the original article
Hit count: 136
JavaScript
|regex
var exampleURL = '/example/url/345234/test/';
var numbersOnly = [?]
The /url/
and /test
portions of the path will always be the same.
Note that I need the numbers between /url/
and /test
. In the example URL above, the placeholder word example might be numbers too from time to time but in that case it shouldn't be matched. Only the numbers between /url/
and /test
.
Thanks!
© Stack Overflow or respective owner