Try typing this into Chrome's JS console. It's a regex I found to check if something's a valid URL or not:
"http://www.kvraudio.com/".match(/^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$/);
A match is returned, as it should be. Now try this:
"tp:/www.kvraudio.com/forum/viewtopic.php".match(/^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$/);
Null is returned, because it doesn't match. Now..... try this:
"http://www.kvraudio.com/forum/viewtopic.php?p=5238905".match(/^(https?://)?([da-z.-]+).([a-z.]{2,6})([/w .-]*)*/?$/);
Nothing! JS appears to be dead or stuck in a loop somehow. If I use the above in an actual web page, it stops responding. Won't even scroll! Anyone got any sort of explanation for that then? What have I done wrong?!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…