I am trying to write a regex (with very little luck) to capture a string that occurs between two slashes in a specific location within a larger string.
An example so
You can use following regex :
"^\/[^/]+\/([^/]+)\/"
See demo https://regex101.com/r/jR9rV5/1
[^/] is a negated character class which match any string except /.
[^/]
/