2 minutes reading an rfc about uris and I find a regex literally used in the specs:
https://www.rfc-editor.org/rfc/rfc3986#page-7
>> The following line is the regular expression for breaking-down a well-formed URI reference into its components.
>> ^(([^:/?#]+):)?(//([^/?#]))?([^?#])(\?([^#]))?(#(.))?
Did Chomsky die for nothing?
I guess there are reasons to do things efficiently when possible, but a million URLs is not it, the adage about the root of all evil comes to mind. A billion URLs per second and it's almost interesting, but not really.