Validate letters and numbers only?

Hey guys :D,

Could someone please help me out here. I’m trying to create a function in FMX that validates a field for numbers and letters only, i.e. no special characters. I know how to check for number strings and so on but trying to check for letters in a string?

I used to have a PHP function that did this for my password field (below) and I would like to do something similar in Flash


function valid_password($pwd){
   // check valid password
   if(!eregi("^[a-z0-9]{1,15}$",$pwd))
   {
     return false;
   }
   else
   {
      return true;
   }
   
}

Thanks in advance!