mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
6 lines
254 B
JavaScript
6 lines
254 B
JavaScript
let regexp = /(?<named>a)|(?<named>b)|c/d;
|
|
|
|
expect("a".match(regexp).indices.groups).toEqual({ named: [0, 1] });
|
|
expect("b".match(regexp).indices.groups).toEqual({ named: [0, 1] });
|
|
expect("c".match(regexp).indices.groups).toEqual({ named: undefined });
|