Is it possible using regex in JavaScript to match a string but only return part of the match?
For example in the string match collections/electronics/products
but only return electronics
https://website.com/collections/electronics/products/some-product
This is what I have so far:
/(\/collections\/)(.*?)(\/products\/)/ig