fork download
  1. <?php
  2.  
  3. $id = "4567 3423 4567";
  4. $regex = "/^(?:[2-9]\d{2} \d{3}|\d{4} \d{4}) \d{4}$/";
  5. if (preg_match($regex, $id)) {
  6. echo "Found a match!";
  7. } else {
  8. echo "The regex pattern does not match. :(";
  9. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Found a match!