|
truello
Nov 28, 2007, 6:09 PM
Post #1 of 3
(1341 views)
Shortcut
Registered: Oct 1, 2006
Posts: 737
|
It isn't that difficult? Here, I even found a good regular expression to use: \w+://(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+\w{2,4}(:[\d]+)?(/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-;+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)? This will avoid posts where someone says http://www.google.com and then someone replies fixed: http://www.google.com. I should mention that the regex is for JavaScript, not PERL.
(This post was edited by truello on Nov 28, 2007, 6:16 PM)
|
|
|
|
|
ddt
Nov 28, 2007, 8:32 PM
Post #2 of 3
(1328 views)
Shortcut
Registered: May 21, 2005
Posts: 2304
|
We already have the mark-up function, which is quite easy to use. It also leaves some flexibility, for the odd case where a non-clickable URL needs to be posted. DDT
|
|
|
|
|
percious
Dec 16, 2007, 8:48 PM
Post #3 of 3
(1270 views)
Shortcut
Registered: May 19, 2005
Posts: 140
|
truello wrote: It isn't that difficult? Here, I even found a good regular expression to use: \w+://(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+\w{2,4}(:[\d]+)?(/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-;+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)? This will avoid posts where someone says http://www.google.com and then someone replies fixed: http://www.google.com. I should mention that the regex is for JavaScript, not PERL. +1
|
|
|
|
|
|