Making links inside text field clickable

Can go part of the way with regular expressions putting in rich text links.

Converted the following to clickable links:

Pattern: (\w+\://\S+)

( and ) capture matching text to be used in the $1 in the replacement.
\w+ matches a word of one or more letters.
\: matches a colon.
// matches two slashes.
\S+ matches one or more non-spaces.

Replace with: [u][url=$1]$1[/url][/u]

$1 is the captured expression from above.
The rest is rich text to show as a url. I added [u] underline to make it visible, could also put in colours.

11 Likes