This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Description
dperini updated the gist
old code
"(?!10(?:\\.\\d{1,3}){3})" +
"(?!127(?:\\.\\d{1,3}){3})" +
"(?!169\\.254(?:\\.\\d{1,3}){2})" +
"(?!192\\.168(?:\\.\\d{1,3}){2})" +
...
// path
"(?:\\/[^\\s]*)?" +
new code
"(?!(?:10|127)(?:\\.\\d{1,3}){3})" +
"(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" +
...
// resource path
"(?:[/?#]\\S*)?" +
major change is that http://example.com?query and http://example.com#query used to be detected as invalid (that's bad), while the new regex allows them