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