fork download
  1. <?php
  2.  
  3. $str = 'foo234234bar()"""';
  4. $regex = '/^(?![\'"]+$)[a-z\d \(\)\'"]+$/i';
  5.  
  6. if (preg_match($regex, $str)) {
  7. echo "match found!";
  8. } else {
  9. echo "no match";
  10. }
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
match found!