replace web address with text friendly text
-
I am looking for a way of removing instances of a web address/URL from an amount of text, where the URL is in the format Site Description and replacing/reformatting the text (for a text only newsletter) into a form like Site Description - www.something.com I am running WSH 5.0 - so some advanced regular expression features are out....any other ideas on how this could be achieved??
-
I am looking for a way of removing instances of a web address/URL from an amount of text, where the URL is in the format Site Description and replacing/reformatting the text (for a text only newsletter) into a form like Site Description - www.something.com I am running WSH 5.0 - so some advanced regular expression features are out....any other ideas on how this could be achieved??
The RegExp object was added to VBScript in version 5, and to JavaScript in version 3. Just of the top of my head, you need something like:
<a\s[^>]*?href=['"]([^'">]*?)['"][^>]*?>(.*?)</a>
to be replaced with:
$2 [$1]
(with IgnoreCase = True, Global=True, MultiLine = False)