Q:

Java dot doesn't match 'any character'

Dot should match any character. So why doesn't this regex work?
String url = "http://wikipedia.org";
System.out.println(url.replace("htt.://", ""));

Output: http://wikipedia.org

A:

String.replace() compiles a literal regex. You ought to use String.replaceAll() or String.replaceFirst():
String url = "http://wikipedia.org";
System.out.println(url.replaceFirst("htt.://", ""));

Here is from the Java source code, the method .replace():
/**
 * Replaces each substring of this string that matches the literal target
 * sequence with the specified literal replacement sequence. The
 * replacement proceeds from the beginning of the string to the end, for
 * example, replacing "aa" with "b" in the string "aaa" will result in
 * "ba" rather than "ab".
 *
 * @param  target The sequence of char values to be replaced
 * @param  replacement The replacement sequence of char values
 * @return  The resulting string
 * @throws NullPointerException if <code>target</code> or
 *         <code>replacement</code> is <code>null</code>.
 * @since 1.5
 */
public String replace(CharSequence target, CharSequence replacement) {
    return Pattern.compile(target.toString(), Pattern.LITERAL).matcher(
            this).replaceAll(Matcher.quoteReplacement(replacement.toString()));
}

A:

You are using replace() method. It takes a String not a regex
You can use replaceAll(); which takes a regex like this : replaceAll("htt.://", "");

A:

You need to use replaceAll() which will interpret the first parameter as a regex.
String url = "http://wikipedia.org";
System.out.println(url.replaceAll("htt.://", ""));

Outputs

wikipedia.org

One remark though: I assume you are trying to make both http and https work with your regex. The way you have it right now won't work because it will expect only 1 character and not 2 in the case of "https". In order to make up for this, use
url.replaceAll("htt.*://", "")

