ASP Cleaner

I wrote this code to clean up my own ASP pages, but I thought others could use it too. Just paste your code in top box and hit convert. It will replace all HTML with response.write statements. It will also indent your code to make it cleaner. For example:
<% for i = 1 to 10 %>
    hello world!
<% next %>
becomes: <%
for i = 1 to 10
    response.write(" hello world!")
next
%>
Its even smart enough to take something like: <body bgcolor=<%=bgcolor%>>

<body bgcolor=<%=bgcolor%>> becomes: <%
response.write("<body bgcolor=")
response.write(bgcolor)
response.write("> ")
%>

It will also handle include statements with the appropriate script delimiters around it. So you can paste in a whole ASP pages and get them all converted in one easy step. Be sure to enclose code in script delimiters <% and %> because "area=length*width" will become, quite correctly, "response.write("area=length*width")". So be sure that if you are converting code, you enclose it within script delimiters, otherwise its just html code and will be wrapped in response.write statements. I've already been told it doesn't work well with JScript. Too bad, that will have to be in version 2. Enjoy.

Original Code:

Converted Code:


Please drop me a line and let me know what you think or if you find any bugs -Jody Powlette