The one thing I always stumble on regardless of how long I’ve been working with JavaScript is that any regex with the global modifier is stateful. If you do use it twice on the same string you’ll get different results https://twitter.com/marvinhagemeist/status/1243072397806313472?s=20