Here's the section of code:
var
[...snip...]
ye=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,
This regular expression is used twice, both times with ye.test(a)
. And yet, I've found no strings that it doesn't match. I find that hard to believe, but
does this RegExp
really match every string imaginable?
Demonstration:
var ye = /^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;
console.log(ye.test("askjvhlkauehavkn"))
console.log(ye.test("/"))
console.log(ye.test("https:"))
console.log(ye.test("mailto/L:"))
See Question&Answers more detail:os