For some time I’ve been trying to understand regular expressions in JavaScript, but it is extremely complicated. You could tell me how do I redeem separately each of the values from the URL below using regular expressions?
URL
/first/middle/last
Return
var first = "first"
var middle = "middle"
var last = "last"
Thanks!
I think you should use
split()for this kind of thing, but if you really like to useregexpyou could do this: