Solved

RegExp Replace object on TextStream not working

Posted on 2001-08-24
2
247 Views
Last Modified: 2008-03-06
I am using the textStream object to output the contents of an HTML file. As its outputting i want to search for html tags and replace them, however it would seem to match the > and < characters.

For instance if i search for "/b" and replace it with something else it works. Whereas if i try to replace "</b>" it doesnt work. Ive tried "&lt/b&gt" and still no joy.

What is the problem with the > and < characters? The textStream is set to ASCII format (tristate false).

Secondly, if i find an html tag, i want to stop the stream, response.write the equivalent code in HTML format and then continue streaming again, how could i do that?

thanks
0
Comment
Question by:RichBisset
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
AlfaNoMore earned 75 total points
ID: 6421472
Ermmm, just use Server.HTMLencode! It will convert all <'s and >'s to &lt; and &gt;, thus preventing the tags being parsed by the browser.

objTS = objFSO.openAsTextStream(filename)

Response.write Server.HTMLencode(objTS).

Easy?
0
 

Author Comment

by:RichBisset
ID: 6421581
Thanks,

The problem was i was using Sever.HTMLencode in the first place!! that will teach me for copying code from a book without thinking what its doing.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question