Dan Fitzpatrick wrote:
>
> [...]

This is reworked with the backslash backrefs I mentioned:

res = str.gsub(/([\s|\>|\[|\(])((ftp:\/\/|http(s?):\/\/))([\w\.\?\/&=\-~:%]+)\b/i,
                '\1<a href="\3\5\6" target="_blank">\5\6</a>')


> Thanks for the explanation. That works great.
>
> Dan
>

Y'welcome,

daz