Tags: validate

Sort by: Date / Title /

  1. 2 months ago by nox.freak
    Checks emails format, unlike others it supports have a plus (+) sign in the address. NOTE: this is easy for the user to by pass, as it is in javascript witch is not server side code.
    1. function emlChk(str) // email format checker/validator.
    2. {
    3.         var filter=/^([\w-]+((?:\.|\+)[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    4.         if(filter.test(str))
    5.         {
    6.                 return true
    7.         } else {
    8.                 return false
    9.         }
    10. }
  2. 4 months ago by sx
    1. /*method validateZipCode*/
    2.         public bool validatePLZ(string PLZ)
    3.         {
    4.             string plzPattern = @"^(D-)?\d{5}$";
    5.             Regex re = new Regex(plzPattern);
    6.             Match ma = re.Match(PLZ);
    7.             if (ma.Success)
    8.                 return true;
    9.             else
    10.                 return false;
    11.         }
  3. 4 months ago by sx
    1. /*method validateMail*/
    2.         public bool validateMail(string Mailadress)
    3.         {
    4.             string mailPattern = @"^[\w\._]{1,}@[\w\._]{2,}\.\w{2,4}$”;
    5.             Regex re = new Regex(mailPattern);
    6.             Match ma = re.Match(Mailadress);
    7.             if (ma.Success)
    8.                 return true;
    9.             else
    10.                 return false;
    11.         }
  4. sponsorised links

First / Previous / Next / Last / Page 1 of 1 (3 posteets)