tc39 / proposal-regexp-atomic-operators

https://rbuckton.github.io/proposal-regexp-atomic-operators
BSD 3-Clause "New" or "Revised" License
16 stars 1 forks source link

Error in README #5

Open dead-claudia opened 20 hours ago

dead-claudia commented 20 hours ago

It is worth noting that lookaround operators (i.e., (?=), (?!), (?<=), and (?<!)) are already atomic operations.

This is technically correct because the backtracking state from inside the group is discarded before continuing outside the group, but it's extremely misleading to state this without that explanation.

Inside the lookahead, it's very much not discarded, and this should also be clarified in the README. https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvEAXwvW10QICsEqdBk2J4ADgAoA9BgkB+ALwAjagB8lASin5GcYhIA6IAB4YVRjRoNpJM+QEIV6rTvj6jp8yEvXb8gDzKapoY2rruJioYFlY20gGOwRqhrnqGkdTR3hqUIHAwsNTEEPQIPABMiOUArGwcIJg4ePjUcAI09IzMPGwAuqxAA