diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 6f3d88c..75ce01b 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -207,7 +207,7 @@ def uri_replace(ud, uri_find, uri_replace, d):
         elif loc == 0:
             # Principle of least surprise. We could end up with https matching against http and 
             # generating "files://" urls if we use the regexp engine below.
-            if i != uri_decoded[loc]:
+            if not re.match(i, uri_decoded[loc]):
                 return None
             result_decoded[loc] = uri_replace_decoded[loc]
         elif (re.match(i, uri_decoded[loc])):
