Every line of 'regex numbers only' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
61 function getRegex (isDecimal: boolean): RegExp { 62 return new RegExp( 63 isDecimal 64 ? `^(0|[1-9]\\d*)(\\${KEYS.DECIMAL}\\d*)?$` 65 : '^(0|[1-9]\\d*)$' 66 ); 67 }