lundi 20 juillet 2015

Regexp in Javascript

I want to test a regular expresion like this: 213+123, a number plus + plus a number. This is de code:

var re = /\d+[+]\d+/
result = window.eval(command);
var bool = re.test(result);

The code respond false if I try to enter 234+234. Any help

Aucun commentaire:

Enregistrer un commentaire