JavaScript regular expressions: `.lastIndex` and the flags `/g` and `/y`

added by JavaScript Kicks
1/1/2020 9:25:22 AM

226 Views

In this blog post, we examine how the RegExp flags /g and /y work and how they depend on the RegExp property .lastIndex. We'll also discover an interesting use case for .lastIndex that you may not have considered yet. Table of contents: Iterates over an input string. Produces zero or more results.


0 comments