Advertisement
julong

regular_th_en_email

Jun 24th, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. //regular
  3. $datefilter = "/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/";
  4. $numberfilter = "/^([0-9])/";
  5. $emailfilter = "/^.+\.com$/";
  6. $usernamefilter = "/^([a-zA-Z]+)([a-zA-Z0-9_\-]{5,32})+$/";
  7. $idcardfilter = "/^([0-9]{13,13})/";
  8. $filter = "/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/";
  9. $mfilter = "/^0([8-9]{1})([0-9]{1})([0-9]{3})([0-9]{4})$/";
  10. $thfilter = "/^([^a-zA-Z0-9_\.\@\-\%])/";
  11. $passwordfilter = "/^([a-zA-Z0-9_\.\-\@\%]{8,32})+$/";
  12.  
  13. //Start demo
  14. $booleanx = preg_match($filter_th,"ดำำำำำfaaaaaa", $matches_out);
  15. echo $booleanx;
  16. echo "<p/>";
  17. foreach ($matches_out as $key => $value) {
  18. $key = utf8_encode($key);
  19. $value = utf8_encode($value);
  20. echo "<br/>".$key." => ".$value;
  21. }
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement