I have recently been using a similar construct to turn 'links' in my XML documents (that become an HTML file) into real links. However, using $1 for both the title and the URL was not flexible enough, so (inspired by this site) i decided to use the form [URL|title] and this regex:
s/\[([^ |]+)\|([^\]]+)\]/<a href="$1">$2<\/a>/g;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR F--F--F--F--F--F--F--F-- (the triplet paradiddle)
In reply to (jeffa) Re: Pesky little URL files to HTML
by jeffa
in thread Pesky little URL files to HTML
by hsmyers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |