fork download
  1. <?php
  2.  
  3. $strings = array("http://w...content-available-to-author-only...e.com", "mailto:hey@there.nyc", "tel:951261412", "hyyy://www.me.com");
  4.  
  5. foreach($strings as $string){
  6.  
  7. if (preg_match('/^((?:tel|https?|mailto):.*?)$/im', $string)) {
  8. echo $string ."\n";
  9. }else{
  10. echo "No Match for : $string \n";
  11. }
  12. }
  13.  
Success #stdin #stdout 0.02s 24192KB
stdin
Standard input is empty
stdout
http://w...content-available-to-author-only...e.com
mailto:hey@there.nyc
tel:951261412
No Match for : hyyy://www.me.com