fork(1) download
  1. <?php
  2.  
  3. $string = 'MyHomeIsHere';
  4. $regex = '~
  5. ^ # the beginning
  6. (?=[^a-z]*[a-z]) # at least one lower case
  7. (?=[^A-Z]*[A-Z]) # at least one upper case
  8. (?=\D*\d) # at least one digit
  9. [\da-zA-Z]{8,30} # digits and characters from a-z
  10. $ # the end
  11. ~x';
  12.  
  13. $password = "Someveryweakpassword123";
  14. if (preg_match($regex, $password)) {
  15. echo "Yes, it does";
  16. }
  17. ?>
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Yes, it does