Today after two posts [#1, #2] in the past days here’s something that shows again the JavaScript power. This is not a complete example, but it’s good to start.
var str = '/text/1/text/2/'; var a = str.match(/(\d+)/gi); console.log(a); |
in that example you’ll get an array with all the numbers in the string [“1”, “2”] – yet another flexible js snippet!