Hello,

Using reg exps I want to replace text enclosed in <link></link> tags with <a
href="..."> tags.

var p:RegExp = /<link\b[^>]*>(.*?)<\/link>/gi;
// the replace() replaces al <link>...</link> occurences with <a
href="google">google</a>
s = s.replace(p,"<a href='http://www.google.be' target='_blank'>
www.google.be</a>");


Example:
=======

<link>www.mywebsite.com</link>

becomes ( the www.google.be part is hardcoded in my s.replace() method )

<a href='http://www.google.be' target='_blank'>www.google.be</a>


Question:
=========
How can I replace the www.google.be part with www.mywebsite.com ?
In other words: how can I pull out the innerHTML and use it in my replace
method ?


Kind regards,
Bram

Reply via email to