peegee: Variable nach Sonderzeichen durchsuchen.

Beitrag lesen

hey leute,

möchte eine variable (this.value) nach buchstaben, zahlen, sonderzeichen durchsuchen und durch die Anzahl der jeweiligen Art wird dann in einer if-abfrage etwas gesteuert.
die abfrage der buchstaben und zahlen funktioniert, bei den sonderzeichen kommt allerding ein folgende fehlermeldung: "Unerwarteter Quantifizierer"

ich geb euch mal den dafür notwendigen code, vielleicht könnt ihr mir ja weiterhelfen:

var AZEICHEN = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
var AZAHL = new Array("0","1","2","3","4","5","6","7","8","9");
//var ASONDER = new Array("","´","~","!","@","#","$","§","°","^","&","\*","(",")","\_","+","-","/","=","{","}","|","[","]","\",":",";","<",">","?",",",".",""","'",";"); var ASONDER = new Array("","´","~","!","@","#","$","§","°","^","&","*","(",")","_","+","-","/","=","{","}","|","[","]","?",".",":",";",",",'"',"'","<",">","?");

var ANZAHL=0;
var PASSWORT;

.
.
.

function check()
    {
    if(ANZAHL != this.value.length)
    {

var ZEICHEN = 0;
     var ZAHL = 0;
     var SONDER = 0;

//AKTUELL = letztes Zeichen
     var AKTUELL;
     AKTUELL = this.value.substr(this.value.length-1,this.value.length);

PW=this.value;
     for(var a=0;a<=(AZEICHEN.length-1);a++)
     {
      var ZEICHENERGEBNIS = PW.search(AZEICHEN[a]);
      if(ZEICHENERGEBNIS != -1)
      {
         ZEICHEN++;
      }
     }

for(var b=0;b<=(AZAHL.length-1);b++)
     {
      var ZAHLERGEBNIS = PW.search(AZAHL[b]);
      if(ZAHLERGEBNIS != -1)
      {
         ZAHL++;
      }
     }

for(var c=0;c<=(ASONDER.length-1);c++)
     {
      var SONDERERGEBNIS = PW.search(ASONDER[c]);
      if(SONDERERGEBNIS != -1)
      {
         SONDER++;
      }
     }
    }
    ANZAHL = this.value.length;

if(SONDER <2)
    {
     ....
    }

if(SONDER >1)
    {
     ...
    }

hoffe man kann erkennen was der code bewirken soll.

thx,
peegee