public static String getUrlRegex(String url1, String url2){
		StringBuilder firstPart = new StringBuilder();
		StringBuilder secondPart = new StringBuilder();
		int i=0;
		if (url1.length()<url2.length()){
			for (; i<url1.length(); i++){
				if(url1.charAt(i)==url2.charAt(i)){
					firstPart.append(url1.charAt(i));
				} else {
					break;
				}
			}
			if(i<url1.length() && url2.contains(url1.substring(i))){
				secondPart.append(url1.substring(i));
			}

		} else {
			for (; i<url2.length(); i++){
				if(url1.charAt(i)==url2.charAt(i)){
					firstPart.append(url2.charAt(i));
				} else {
					break;
				}
			}
			if(i<url2.length() && url1.contains(url2.substring(i))){
				secondPart.append(url1.substring(i));
			}

		}
		String regex = "^"+firstPart.toString()+".*"+secondPart.toString()+"$";
		setDiscussionsUrlStart(firstPart.toString());
		setDiscussionsUrlEnd(secondPart.toString());
		return regex;
		
	}