<?php
$regexp = '!^htt(p|ps)://([^\s]+){3}$|(^$)!';
'http://wt_import(filename)',
'https://1232145',
'http://eom',
'https://content-available-to-author-only.html#465723',
'',
);
'http://example com with many spaces',
' https://2...content-available-to-author-only.....contenttml#465723',
'http, http://, example.com',
'http://ex',
'http://',
'l',
' http:// ',
'https:// ',
'https:// DF',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' sdfsdf ',
'sdfsdf sdfsdf ',
'qeqweqw',
' ',
);
echo "TRUE\n\n";
foreach ($correctNumber as $number) {
echo "[+] \"{$number}\"\n";
} else {
echo "[-] \"{$number}\"\n";
}
}
echo "\nFALSE\n\n";
foreach ($wrongNumber as $number) {
echo "[+] \"{$number}\"\n";
} else {
echo "[-] \"{$number}\"\n";
}
}
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgokcmVnZXhwID0gJyFeaHR0KHB8cHMpOi8vKFteXHNdKyl7M30kfCheJCkhJzsKCiRjb3JyZWN0TnVtYmVyID0gYXJyYXkoCiAgICAnaHR0cDovL3d0X2ltcG9ydChmaWxlbmFtZSknLAogICAgJ2h0dHBzOi8vMTIzMjE0NScsCiAgICAnaHR0cDovL2VvbScsCiAgICAnaHR0cHM6Ly9jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS5odG1sIzQ2NTcyMycsCiAgICAnJywKKTsKCiR3cm9uZ051bWJlciA9IGFycmF5KAogICAgJ2h0dHA6Ly9leGFtcGxlIGNvbSB3aXRoICAgICBtYW55IHNwYWNlcycsCiAgICAnIGh0dHBzOi8vMi4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uLi5jb250ZW50dG1sIzQ2NTcyMycsCiAgICAnaHR0cCwgaHR0cDovLywgZXhhbXBsZS5jb20nLAogICAgJ2h0dHA6Ly9leCcsCiAgICAnaHR0cDovLycsCiAgICAnbCcsCiAgICAnIGh0dHA6Ly8gJywKICAgICdodHRwczovLyAnLAogICAgJ2h0dHBzOi8vIERGJywKICAgICcgJywKICAgICcgICcsCiAgICAnICAnLAogICAgJyAgICcsCiAgICAnICAgICcsCiAgICAnICAgICAnLAogICAgJyAgICAgICcsCiAgICAnICAgICAgICcsCiAgICAnICAgICAgICAgICcsCiAgICAnICAgICAgICAgICAgJywKICAgICcgICAgICBzZGZzZGYgICAgICAnLAogICAgJ3NkZnNkZiAgICAgIHNkZnNkZiAgICAgICcsCiAgICAncWVxd2VxdycsCiAgICAnICAgICAgICAgICAgJywKKTsKCmVjaG8gIlRSVUVcblxuIjsKCmZvcmVhY2ggKCRjb3JyZWN0TnVtYmVyIGFzICRudW1iZXIpIHsKICAgIGlmIChwcmVnX21hdGNoKCRyZWdleHAsICRudW1iZXIpKSB7CiAgICAgICAgZWNobyAiWytdIFwieyRudW1iZXJ9XCJcbiI7CiAgICB9IGVsc2UgewogICAgICAgIGVjaG8gIlstXSBcInskbnVtYmVyfVwiXG4iOwogICAgfQp9CgplY2hvICJcbkZBTFNFXG5cbiI7Cgpmb3JlYWNoICgkd3JvbmdOdW1iZXIgYXMgJG51bWJlcikgewogICAgaWYgKHByZWdfbWF0Y2goJHJlZ2V4cCwgJG51bWJlcikpIHsKICAgICAgICBlY2hvICJbK10gXCJ7JG51bWJlcn1cIlxuIjsKICAgIH0gZWxzZSB7CiAgICAgICAgZWNobyAiWy1dIFwieyRudW1iZXJ9XCJcbiI7CiAgICB9Cn0K