How to get the number/number at the end of the line?

const name1 = 'windows-x64-pc-anna3'; // (3)
const name2 = 'windows-x64-pc-michael-0012'; // (0012)

const name3 = 'windows-x64-pc-michael-vladimir'; // ()


How to get the number only at the end of the line? If nothing, return null or void.

I have something happened - https://jsfiddle.net/fqqwc2ba/ but all Talitsa on the last example, it will return 64.
June 10th 19 at 15:46
1 answer
June 10th 19 at 15:48
Solution
Add the $ in the regular season, note that it is possible to obtain null. For example so.

Find more questions by tags JavaScript