javascript regex - test is not a function -


i'm trying validate password , if ok, keep in array regular expression once. when run script in mozilla browser, following error: 'seguridadpass [i]. test not function'. know how can delete array 'comprobaciones', regex have not been used. thank help.

code

javscript

var compmay = /[a-zÑ]/; var compmin = /[a-zñ]/; var compnum = /(?=.*\d)/; var compcaresp = /[!@#$%^&*(){}[\]<>¿¡?/|.:;_-]/; var seguridadpass = [];  seguridadpass.push(compmin,compmay,compnum,compcaresp); comprobaciones = [];  $('#write').keyup(function(){  var pass = $(this).val(); if(pass!=''){     for(i=0;i<seguridadpass.length;i++){         if(seguridadpass[i].test(pass)){             //alert(seguridadpass[i]);             for(j=0;j<comprobaciones.length;j++){                 if(comprobaciones[j]!=seguridadpass[i]){                     comprobaciones.push(seguridadpass[i]);                 }             }         }     } } else{     comprobaciones.splice(0,comprobaciones.length);     //comprobaciones = []; } }); 

seguridadpass.push(compmin,compmay,compnum,compcaresp,8); 

8 not regexp.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -