Java tutorial
//package com.java2s; public class Main { public static boolean isMapsURL(String url) { return url.matches("http[s]://maps\\.google\\.[a-z]{2,3}(\\.[a-z]{2})?[/?].*") || url.matches("http[s]://www\\.google\\.[a-z]{2,3}(\\.[a-z]{2})?/maps.*"); } }