Node.js examples for Regular expression:Match
Is string a digit via regex
function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)){ return false ; }/*from ww w . j a v a 2s . c o m*/ return true ; }