1var regexp = /^\d+(\.\d{1,2})?$/;
2
3console.log("'.74' returns " + regexp.test('.74'));
4console.log("'7' returns " + regexp.test('7'));
5console.log("'10.5' returns " + regexp.test('10.5'));
6console.log("'115.25' returns " + regexp.test('115.25'));
7console.log("'1535.803' returns " + regexp.test('1535.803'));
8console.log("'153.14.5' returns " + regexp.test('153.14.5'));
9console.log("'415351108140' returns " + regexp.test('415351108140'));
10console.log("'415351108140.5' returns " + regexp.test('415351108140.5'));
11console.log("'415351108140.55' returns " + regexp.test('415351108140.55'));
12console.log("'415351108140.556' returns " + regexp.test('415351108140.556'));