Index: wp-admin/includes/class-wp-comments-list-table.php
===================================================================
--- wp-admin/includes/class-wp-comments-list-table.php	(revision 27218)
+++ wp-admin/includes/class-wp-comments-list-table.php	(working copy)
@@ -497,7 +497,7 @@
 		$author_url = get_comment_author_url();
 		if ( 'http://' == $author_url )
 			$author_url = '';
-		$author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
+		$author_url_display = preg_replace( '|^http://(www\.)?|i', '', $author_url );
 		if ( strlen( $author_url_display ) > 50 )
 			$author_url_display = substr( $author_url_display, 0, 49 ) . '&hellip;';
 
Index: wp-admin/network.php
===================================================================
--- wp-admin/network.php	(revision 27218)
+++ wp-admin/network.php	(working copy)
@@ -51,7 +51,7 @@
  * @return bool Whether subdomain install is allowed
  */
 function allow_subdomain_install() {
-	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
+	$domain = preg_replace( '|^https?://([^/]+)|', '$1', get_option( 'home' ) );
 	if( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) )
 		return false;
 
@@ -93,7 +93,7 @@
 function get_clean_basedomain() {
 	if ( $existing_domain = network_domain_check() )
 		return $existing_domain;
-	$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
+	$domain = preg_replace( '|^https?://|', '', get_option( 'siteurl' ) );
 	if ( $slash = strpos( $domain, '/' ) )
 		$domain = substr( $domain, 0, $slash );
 	return $domain;
Index: wp-includes/default-constants.php
===================================================================
--- wp-includes/default-constants.php	(revision 27218)
+++ wp-includes/default-constants.php	(working copy)
@@ -211,13 +211,13 @@
 	 * @since 1.2.0
 	 */
 	if ( !defined('COOKIEPATH') )
-		define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) );
+		define('COOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('home') . '/' ) );
 
 	/**
 	 * @since 1.5.0
 	 */
 	if ( !defined('SITECOOKIEPATH') )
-		define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
+		define('SITECOOKIEPATH', preg_replace('|^https?://[^/]+|i', '', get_option('siteurl') . '/' ) );
 
 	/**
 	 * @since 2.6.0
@@ -229,7 +229,7 @@
 	 * @since 2.6.0
 	 */
 	if ( !defined('PLUGINS_COOKIE_PATH') )
-		define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL)  );
+		define( 'PLUGINS_COOKIE_PATH', preg_replace('|^https?://[^/]+|i', '', WP_PLUGIN_URL) );
 
 	/**
 	 * @since 2.0.0
Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 27218)
+++ wp-includes/formatting.php	(working copy)
@@ -3089,7 +3089,7 @@
  * @return string Absolute path.
  */
 function wp_make_link_relative( $link ) {
-	return preg_replace( '|https?://[^/]+(/.*)|i', '$1', $link );
+	return preg_replace( '|^https?://[^/]+(/.*)|i', '$1', $link );
 }
 
 /**
