I have the following URL:
http://data.test.com/api/v1/entity/1231
And I need to get the text that is after v1/ and before / (between the slashes), in this case the word entity. I'm using the following regex, but what I get back is entity/1231 on group 1:
/^[^\#\?]+\/v1\/([^\?]+).*$/
Any idea on how to get rid of 1231 or anything that comes after entity?
v1\/([^/]+)orv1\/(.*?)\/"http://data.test.com/api/v1/entity/1231".split("/")[5]v1/and before [the next]/"?str.match(/\/v1\/([^\/]+)/)[1]