regex for only numbers javascript code example
Example 1: get only numbers regex javascript
var numberPattern = /\d+/g;
'something102asdfkj1948948'.match( numberPattern )
Example 2: just number regex js
// https://regex101.com/r/qyq3PG/1
// or
/^[0-9]*$/