coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
and make it into[url|desc|target]
On top of that, the last part (target) is optional so if it's not added, the url will open in the same window.<a href="url" target="target">desc</a>
What I've been trying is this (yes, I want ANYTHING inside to be linked. Even if they accidently just type in the letters "asd" it would make that into a link)[www.test.com|test page] would make <a href="www.test.com">test page</a> [www.test.com|test page|new] would make <a href="www.test.com" target="new">test page</a>
Thanks everyone.s/\[(.+\/\/.+?)\|(.+?)\]/<a href="$1" target="new">$2<\/a>/gi;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Link regex
by tachyon (Chancellor) on May 21, 2004 at 00:11 UTC | |
|
Re: Link regex
by injunjoel (Priest) on May 20, 2004 at 23:51 UTC | |
|
Re: Link regex
by saintmike (Vicar) on May 20, 2004 at 23:53 UTC | |
|
Re: Link regex
by dimar (Curate) on May 21, 2004 at 06:09 UTC | |
by tachyon (Chancellor) on May 21, 2004 at 12:51 UTC | |
by dimar (Curate) on May 21, 2004 at 16:08 UTC | |
by dimar (Curate) on May 21, 2004 at 16:34 UTC |