I once came across a bug in a codebase I inherited that parsed URI-references from HTML documents. That bug was caused by using that very same regular expression.
The string "foo" correctly gets parsed as a path (group 5). However the string "foo;key:value" gets parsed as a "foo;key" scheme (group 1,2) and a "bar" path (group 5) by the regular expression, but as a path if you follow the grammar.
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
vs.
^(([^:\/?#]+):)?
:; are reserved characters, but they do not need to be encoded when they are a part of the path.
So yeah, don't use regular expressions for parsing.