Currently I have a use case where I need to grab the first path after '/#/' in url until '/'
// lookbehind and lookahead
'https://stackoverflow.com/questions/#/ask/anything-here'
.match(/(?<=\/#\/).+(?=\/)/)
// ["ask" ...] I get word 'ask' in this case.
// supported in old browser
'https://stackoverflow.com/questions/#/ask/anything-here'
.match(/\/#\/(.+)\//)
// ["/#/ask/", "ask", ...] I can get word 'ask' in res[1]
Im using positive lookbehind and positive lookahead here but as soon as I run unit test in CI/CD, it error because we are still using old browser version(Chrome 56) while my machine is using Chrome 76.
In caniuse website https://caniuse.com/#feat=js-regexp-lookbehind, Chrome start to support lookahead and lookbehind on version 62.
So my question is, it is possible to polyfill or ponyfill lookahead, lookbehind and name groups regex to old browsers.