I'm using the following regex to match the word 'stores' between '/' and '?' with a possible forward slash '/' before the '?' but for some reason it fails saying there's an invalid quantifier. Any idea why it might be wrong and quatifier is that? I tried removing '/?' but it still says the same thing.
var n=str.match(/(?<=\/)stores\/?(?=\?)/);
Thanks!