On 16 May 2004 15:52:43 GMT, "Evertjan."
:John Smith wrote on 16 mei 2004 in
:microsoft.public.inetserver.asp.general:
:
:> On 16 May 2004 08:09:06 GMT, "Evertjan."
:>
:>:John Smith wrote on 16 mei 2004 in
:>:microsoft.public.inetserver.asp.general:
:>:
:>:> How would I strip all <a href=""></a> tags from a block of text
:>:> using ASP?
:>:>
:>:> I assume you would need to find "<" and ">" tags, but I am not sure
:>:> how you would actually remove it from the text. Any help would be
:>:> greatly appreciated!
:>:>
:>:
:>:Since you do not specify the language,
:>:I take the freedom of using jscript.
:>:
:>:Furthermore I suppose you want to keep the tag's innertext:
:>:
:>:t = 'zz <a href="blah.com">blah</a> zz'
:>:
:>:t = t.replace(/(<a[^>]+>)|(<\/a>)/gi,"")
:>
:>
:> I should have specified that I am using VBScript. I tried modifying
:> the code above, but I have little experience with regular expressions
:> in VBScript.
:
:
:t = "zz <a href='blah.com'>blah</a> zz"
:
:Set regEx = New RegExp
:regEx.Pattern = "(<a[^>]+>)|(<\/a>)"
:regEx.IgnoreCase = True
:regEx.Global = True
:t = regEx.Replace(t, "")
THANK YOU!