Node.js examples for Regular expression:Match
Is String an integer or float by regex
String.prototype.isInteger = function() { return /^[\+\-]?(?:0x[0-9a-f]+|0[0-7]+|[0-9]+)$/i.test(this); } String.prototype.isFloat = function() { return /^[\+\-]?(\d+|\d*(?:\.\d+){1})(?:[eE][\+\-]?\d+)?$/.test(this); } String.prototype.isNumber = function() { return this.isInteger() || this.isFloat(); }