What does this expression return?
'x1 y2 x3'.match(/(?<!x)\d/g)
- ['2']
- ['1', '3']
- ['1', '2', '3']
- ['y2']
The negative lookbehind
Play Regex ▸
(?<!x) skips digits that come right after an "x".'x1 y2 x3'.match(/(?<!x)\d/g)
(?<!x) skips digits that come right after an "x".