var str= 'asd,asd,12,321,,123,6,yrtv,x,z'; How many ways are there to get the numbers?
var str= 'asd,asd,12,321,,123,6,yrtv,x,z';
A regular method, use split to split into arrays. Is it possible to use the filter method of the array? Please solve it and write it down one by one. Thank you.
Example 1:
var reg = /\d+/g;
var str = "ss12345rr3432re232";
var ms = str.match(reg)
str.split(",").filter(a => a !== "" && !isNaN(+a))