Regex 将asp页响应.writes转换为html的正则表达式

Regex 将asp页响应.writes转换为html的正则表达式,regex,refactoring,asp-classic,Regex,Refactoring,Asp Classic,我有这个 Response.write "<table width=""700"" border=""0"">" Response.write "<tr><td width=""10%"">&nbsp;<td align=center pagetitle2strong""><br><strong>Advanced Sales Search</strong><br><br>

我有这个

Response.write "<table width=""700"" border=""0"">"

    Response.write "<tr><td width=""10%"">&nbsp;<td align=center pagetitle2strong""><br><strong>Advanced Sales Search</strong><br><br></td></tr>"

    Response.write "<tr><td width=""10%"">&nbsp;<td>"

    ShowSearchDisclaimer    

    Response.write "<table border=0><tr><td width=""10%"">&nbsp;<td>"

    ShowForm

    Response.write "</td></td></tr></table>"

    Response.write "</td></tr></table>"
Response.write“”
Response.write“
高级销售搜索” 响应。写入“” ShowSearch免责声明 响应。写入“” 展示形式 响应。写入“” 响应。写入“”
在视图中源看起来像这样…只是一个大斑点

<table width="700" border="0"><tr><td width="10%">&nbsp;</td><td align="right" ><h1>Search Sales or Transfers</h1></td></tr><tr><td width="10%">&nbsp;</td><td><table width=600 border=0><tr><td><font size=+1><b>By using this page you are agreeing to the following disclaimer.</b></font></td></tr><tr><td>&nbsp;</td></tr><tr><td>The information appearing on this website was extracted from the records of the office of the Sarasota County Property Appraiser. Our goal is to provide you with the most accurate information possible. The information maintained on this website should not be relied upon for any purposes except for those of the Property Appraiser and his staff. The Sarasota County Property Appraiser accepts no responsibility for the inappropriate use or the misinterpretation of data. No warranties, expressed or implied, are provided for the data herein. The property values relate to the last valuation date, or to preliminary values when noted. The data is subject to change.</td></tr><tr><td>&nbsp;</td></tr><tr><td>By proceeding with a property search you are stating that the notice has been read and that you understand and agree with its contents. The data contained on this site is intended for information purposes only. It is based on the best information available at the time of posting and is not warranted. The data may not reflect the most current records.</td></tr><tr><td>&nbsp;</td></tr><tr><td><a href="/Content/Disclaimer.asp">View Full Disclaimer Here.</a></td></tr><tr><td>&nbsp;</td></tr></table><table><form METHOD=POST NAME=frmPrice ACTION=/search/sales_search_results.asp><tr><td FormDisplayText"><b>Recorded Consideration<p class="teaser">Sale Price</p></b></td><td align=right><input TYPE=text SIZE=8 NAME=AmtFrom title="Minimum Price">&nbsp;<input TYPE=text SIZE=8 NAME=AmtTo title="Maximum Price">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmDate ACTION=/search/sales_search_results.asp><tr><td FormDisplayText"><b>Transaction Date</b></td><td align=right><input TYPE=text SIZE=8 NAME=DateFrom title="Minimum Date">&nbsp;<input TYPE=text SIZE=8 NAME=DateTo title="Maximum Date">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmInstrument ACTION=/search/sales_instrument_search_results.asp><tr><td FormDisplayText"><b>Instrument Number</b></td><td align=right><input TYPE=text SIZE=22 NAME=kw1 title="Enter Complete or Partial Instrument Number">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmDeedType ACTION=/search/sales_deed_type_search_results.asp><tr><td FormDisplayText"><b>Instrument Type</b></td><td align=right><input TYPE=text SIZE=22 NAME=kw1 title="Enter Exact Deed Type">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmGrantor ACTION=/search/sales_grantor_search_results.asp><tr><td FormDisplayText"><b>Seller/Grantor</b></td><td align=right><input TYPE=text SIZE=8 name=kw1 title="Enter part of Grantor's Name">&nbsp;<input TYPE=text SIZE=8 name=kw2 title="Enter part of Grantor's Name">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmSubCode ACTION=/search/sales_search_results.asp?type=code><tr><td FormDisplayText"><b>Subdivision Code</b></td><td align=right><input TYPE=text SIZE=22 name=SubCode title="Enter exact Subdivision Code">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmSubName ACTION=/search/sales_search_results.asp?type=name><tr><td FormDisplayText"><b>Subdivision Name</b></td><td align=right><input TYPE=text SIZE=22 name=SubName title="Enter all or part of the Subdivision Name">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><form METHOD=POST NAME=frmUseCode ACTION=/search/sales_search_results.asp><tr><td FormDisplayText"><b>Land Use Code</b></td><td align=right><input TYPE=text SIZE=8 NAME=UseFrom title="Minimum LUC">&nbsp;<input TYPE=text SIZE=8 NAME=UseTo title="Maximum LUC">&nbsp;<input type=submit value=Submit title="Click to view search results"></td></tr></form><tr><td FormDisplayText">&nbsp;</td></tr><tr><td FormDisplayText"><b>Lookup Subdivision Code</b></td><td align=right><input type=button value=Lookup title="Click to lookup code values" onclick=location.href='/search/subdivision_codes.asp?type=sales'></td></tr></form><tr><td FormDisplayText"><b>Lookup Use Code</b></td><td align=right><input type=button value=Lookup title="Click to lookup code values" onclick=location.href='/search/use_codes.asp?type=sales'></td></tr></form><tr><td FormDisplayText"><b>Lookup Instrument Type</b></td><td align=right><input type=button value=Lookup title="Click to lookup code values" onclick=location.href='/search/deed_types.asp'></td></tr></form><tr><td FormDisplayText"><b>Lookup Transaction Qual. Codes</b></td><td align=right><input type=button value=Lookup title="Click to lookup code values" onclick=location.href='/search/sales_qualification_codes.asp'></td></tr></form></table></td></tr></table>
使用此页面搜索销售或转让您同意以下免责声明。本网站上的信息摘自萨拉索塔县房地产估价师办公室的记录。我们的目标是为您提供尽可能准确的信息。除财产估价师及其工作人员的信息外,本网站上保存的信息不得用于任何目的。萨拉索塔县房地产估价师对数据的不当使用或误解不承担任何责任。本文中的数据不提供任何明示或暗示的保证。物业价值与上一次估价日期有关,或与初步价值有关(如有注明)。数据可能会发生变化。进行财产搜查,即表明您已阅读该通知,并且您理解并同意其内容。本网站包含的数据仅供参考。它基于发布时可用的最佳信息,不作担保。数据可能无法反映最新的记录。交易日期工具类型细分代码土地使用代码查找细分代码查找工具类型

我不认为正则表达式是答案,也不适用于这里

就我个人而言,我会用以下类似的方法来解决您的问题,以使脚本和输出HTML更具可读性:

tableString  = "<table width=""700"" border=""0"">" & _
                    "<tr><td width=""10%"">&nbsp;<td align=center pagetitle2strong""><br><strong>Advanced Sales Search</strong><br><br></td></tr>" & _
                        "<tr>" & _
                        "<td width=""10%"">&nbsp;<td>" & _ 
                        "{SearchDisclaimer}" & _
                        "<table border=0>" & _
                            "<tr><td width=""10%"">&nbsp;<td>" & _
                                "{ShowForm}" & _
                            "</td></td></tr>" & _
                        "</table>" & _
                        "</td></tr>" & _
                "</table>"

tableString = replace(tableString, "{SearchDisclaimer}", ShowSearchDisclaimer())
tableString = replace(tableString, "{ShowForm}", ShowForm())

Response.write(tableString)
tableString=”“&_
“
高级销售搜索”_ "" & _ " " & _ “{SearchDisclaimer}”和_ "" & _ " " & _ “{ShowForm}”和_ "" & _ "" & _ "" & _ "" tableString=replace(tableString,“{SearchDisclaimer}”,ShowSearchDisclaimer()) 表字符串=替换(表字符串“{ShowForm}”,ShowForm()) Response.write(表字符串)
然后将SUB更改为以字符串形式返回HTML的函数,如下所示:

function ShowCriteriaRow()
    outputString = ""
    if strPrint <> "yes" then
        outputString = outputString & "<input id=""textbox"" name=""foo"" value=""bar"" />"
    end if

    ShowCriteriaRow = outputString
end function
函数ShowCriteriaRow()
outputString=“”
如果strPrint为“是”,则
outputString=outputString&“”
如果结束
ShowCriteriaRow=输出字符串
端函数
tableString  = "<table width=""700"" border=""0"">" & _
                    "<tr><td width=""10%"">&nbsp;<td align=center pagetitle2strong""><br><strong>Advanced Sales Search</strong><br><br></td></tr>" & _
                        "<tr>" & _
                        "<td width=""10%"">&nbsp;<td>" & _ 
                        "{SearchDisclaimer}" & _
                        "<table border=0>" & _
                            "<tr><td width=""10%"">&nbsp;<td>" & _
                                "{ShowForm}" & _
                            "</td></td></tr>" & _
                        "</table>" & _
                        "</td></tr>" & _
                "</table>"

tableString = replace(tableString, "{SearchDisclaimer}", ShowSearchDisclaimer())
tableString = replace(tableString, "{ShowForm}", ShowForm())

Response.write(tableString)
function ShowCriteriaRow()
    outputString = ""
    if strPrint <> "yes" then
        outputString = outputString & "<input id=""textbox"" name=""foo"" value=""bar"" />"
    end if

    ShowCriteriaRow = outputString
end function