RFC 3987 compliant URL regex

Published on Tue Mar 01 2022

This is a JavaScript port of the URL regex from http://stackoverflow.com/a/190405/384062 that includes a bug fix and some optimization. Mathias Bynens's Regenerate was used to convert unicode escapes. Bug fix: Eliminated stray | falsely allowing querystring to contain | Optimization: Merged alternated character classes in querystring and fragment identifier portions for better performance.