I want to match a number in a string: 'abc@2003, or something else @2017' I want to get result [2003, 2007] with match function.
let strReg = 'abc@2003, or something else @2017';
let reg = new RegExp(/(?=(@\d+))\1/);
strReg.match(reg) //[ '@2003 ', '@2017 ' ]
let reg1 = new RegExp(/(?=@(\d+))\1/)
strReg.match(reg1) //null, but I expect [2003, 2007]
the result mains '\1' match after '?=', ?=()\1 works, ?=@()\1 not.
javascript only supports backwards, how should I do to match '@' but ignore it?