This regex pattern will match URLs that start with 'http://', 'https://', 'http://www.', 'https://www.', 'http://ww.', or 'https://ww.' followed by 'google.com/maps/embed'. The 'w?' allows for 'www' to be optional.
preg_match('/^https?:\/\/w?w?w?\.google\.com\/maps\/embed/', $url);
Copy