fork download
  1. <?php
  2.  
  3. $n = '123';
  4.  
  5. var_dump(preg_match('.\d+.', $n));
  6. var_dump(preg_match('$\d+$', $n));
  7. var_dump(preg_match('_\d+_', $n));
  8. var_dump(preg_match(':\d+:', $n));
  9. var_dump(preg_match('?\d+?', $n));
  10. var_dump(preg_match('^\d+^', $n));
  11. var_dump(preg_match('%\d+%', $n));
  12. var_dump(preg_match('&\d+&', $n));
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
int(1)
int(1)
int(1)
int(1)
int(1)
int(1)
int(1)
int(1)