I added full support for atomic groups and possessive quantifiers to the regex library. It emulates them using lookahead and backreferences.
import {regex} from 'regex';
// Atomic group
regex`^(?>\w+\s?)+$`;
// Possessive quantifier
regex`a++.`;
Sharing here in case it's helpful for testing their behavior in a working JS library.
This also addresses #2.
Edit: @pygy's compose-regexp.js is the only other JS library I'm aware of that emulates atomic groups, but it uses a different approach with function composition rather than using the atomic group syntax, as shown below:
import {atomic, sequence, suffix} from 'compose-regexp';
// Atomic group
sequence(/^/, suffix('+', atomic(/\w+\s?/)), /$/);
I added full support for atomic groups and possessive quantifiers to the regex library. It emulates them using lookahead and backreferences.
Sharing here in case it's helpful for testing their behavior in a working JS library.
This also addresses #2.
Edit: @pygy's compose-regexp.js is the only other JS library I'm aware of that emulates atomic groups, but it uses a different approach with function composition rather than using the atomic group syntax, as shown below: