The regular expression used in the Decode URL examples was taken from RFC 2396, Appendix B: Parsing a URI Reference with a Regular Expression; for posterity, here's a quote:
The following line is the regular expression for breaking-down a URI
reference into its components.
^(([^:/?#]+):)?(//(...