regex for only number in javascript code example
Example 1: just number regex js
// https://regex101.com/r/qyq3PG/1
// or
/^[0-9]*$/
Example 2: number pattern js
/^[\+\-]?\d*\.?\d+(?:[Ee][\+\-]?\d+)?$/
/*
matched values:
-2.14e10
+14E-20
42.69
*/