| 1 |
let regexp = /(?<named>a)|(?<named>b)|c/d; |
| 2 |
|
| 3 |
expect("a".match(regexp).indices.groups).toEqual({ named: [0, 1] }); |
| 4 |
expect("b".match(regexp).indices.groups).toEqual({ named: [0, 1] }); |
| 5 |
expect("c".match(regexp).indices.groups).toEqual({ named: undefined }); |