$re = '/^(?:htt(?:ps|p):\/\/www\.)(?=(.+\..{3,}))/m';
$str = 'https://www.a;ldkfa.com
https://www.reddit.com/r/regex/comments/pejecb/match_url_without_https_part/
https://www.google.com/search?q=i+was+feeling+kinda+sea+sick&oq=i+was+feeling+kinda+sea+sick&aqs=chrome..69i57j69i64l3.6740j0j7&sourceid=chrome&ie=UTF-8
https://abc.com.
http://192.168.1.255/
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php