i am doing client side validation in Zend framework2 and using regex. test class for this purpose but not getting the correct result i m using in the following way
var regex = new RegExp('/^[a-zA-Z0-9_-\s]{1,50}+$/');
console.log(regex.test(id_val));
but it always returns false. does any one knows how to use it?
newdoes not take delimiters, and two quantifiers after another are also an error. (Your browser’s JS console should have told you about the latter already.)