number only regex javascript code example
Example 1: get only numbers regex javascript
var numberPattern = /\d+/g;
'something102asdfkj1948948'.match( numberPattern )
Example 2: number pattern js
/^[\+\-]?\d*\.?\d+(?:[Ee][\+\-]?\d+)?$/
/*
matched values:
-2.14e10
+14E-20
42.69
*/