<script> var reg = /\d+/; var str = '214321441214'; var arr = str.match(reg); console.log(arr); var reg1=/\d+?/ var arr1=str.match(reg1); console.log(arr1);</script>