RSS

Forums/Postbox/Ideas & Feature Requests

PlannedDoneNot planned

Automatic Hyperlinking in Compose Window

KotW
suggested this on Apr 18 06:02

For numerous reasons, I have to utilize lots of hyperlinks in my e-mails, and manually adding the link to a http://-string every time is beginning to wear on me.

Hence, requesting that Postbox automatically hyperlink URL strings starting with http://!

 

Comments

User photo
Kerin Millar

For HTML messages, this could indeed be useful. As an extension to the idea, it might be useful to match valid hostnames that begin with www (so that specifying the http:// prefix isn't strictly necessary).

Here's a perl-compatible regular expression that does the job:

(^|\b)www\.[\w][\w\.]+
Apr-20 2010 11:37.
User photo
Kerin Millar

Rather more usefully, to capture the hostname:

(?:^|\b)(www\.[\w][\w\.]+)

The first backreference would then contain the hostname, which could simply have http:// prepended.

Apr-20 2010 11:40.
User photo
Kerin Millar

Sigh ... third time's the charm. Underscores aren't allowed, but hypens are. Here's a much better expression:

(^|\b)www(?:\.[[:alnum:]][[:alnum:]\-]+){1,}
Apr-20 2010 11:46.