in another article on Stackoverflow, I found this line of code
myString = 'hello112';
myNumber = myString.match(/\d+/)[0];
In this case, the 'myNumber' variable has the value of 122.
But when I use .match for the following case, it fails:
myColor = 'rgb(210,255,105);
myNumbers = myColor.match(/\d+/);
The 'myNumbers'variable is an array, but it's length is 1 and it contains only '210' and not the other 2 numbers.
Is there a way in Javascript that I can achive something like this?
input = 'rgb(210,255,105);
output = [210,255,105];
Thank you very much.
g:/\d+/g