diff --git a/IRI.php b/IRI.php
index <HASH>..<HASH> 100644
--- a/IRI.php
+++ b/IRI.php
@@ -497,7 +497,7 @@ class IRI
         // http://tools.ietf.org/html/rfc3986#appendix-B
         $regex = '|^((?P<scheme>[^:/?#]+):)?' .
                     '((?P<doubleslash>//)(?P<authority>[^/?#]*))?(?P<path>[^?#]*)' .
-                    '((?<querydef>\?)(?P<query>[^#]*))?(#(?P<fragment>.*))?|';
+                    '((?P<querydef>\?)(?P<query>[^#]*))?(#(?P<fragment>.*))?|';
         preg_match($regex, $iri, $match);
 
         // Extract scheme
Use only Python-style subpatterns to be compatible with older PCRE versions

This closes #4 and fixes lanthaler/JsonLD#<I>