I personally like this idea, and meant to post sooner.
isurl would check if the string is identified as being an url, using the same formula that mIRC uses to determine hotlinks and url catching. Whether it catches ALL TYPES of urls is irrelevant, and best discussed in a seperate thread titled
"Why doesn't mIRC recognize nntp:// urls?"In response to codemastr's question:
"And how does one define what a url is? There is no general way to do it. Every URL scheme defines its own format." As I stated above, it will use the same scheme that mIRC uses to detect these formats currently, however limited/ incomplete/ inaccurate it may be.
I propose the following formats:
if ( string isurl ) // checks if
string can be identified as an url by any known schemes.
if ( string isurl protocol ) // checks if
string can be identified as an url of said
protocol.
Examples:
if (
http://google.com/ isurl ) { true }
if (
www.google.com/ isurl ) { true }
if ( ftp.google.com isurl ) { true }
if (
www.mirc.com isurl http ) { true }
if ( ftp.mirc.com isurl ftp ) { true }
if (
ftp://ftp.mirc.com isurl http ) { false }
if ( ftp.mirc.com:80 isurl http ) { true }
You get the idea.
- Raccoon