im wondering how I can get the number from the following string using regex
<@!1912983319>
I need the number inside of <@!>
i use const regex = /<@!(\d{17,19})>/g; i get to get <@3181> but unsure how to just get the number?
The number inside is just an example number, can be longer or shoter
>Solution :
Just remove(replace any non-number \d by empty string ''):
const num = "<@!1912983319>";
let number = num.replace(/[^\d]+/g,'');//1912983319