研究了一个下午,没有头绪,来论坛求助,老ID丢了!重新注册了一个!=。=!
我想用javascript正则提取asp代码中SQL行的表达式但是写来写去都不行,各位辛苦帮忙看看!
想提取引号中的SQL表达式
strSql="Select * from project354 where ID = "&Request("id")& and Name='111'"
- <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script> function getSqlCode(){ str11=document.all("_ASPeditor").value; /(.*)strSql=(.*)[^"]*$/gi.test(str11); ssss1=RegExp.$2; alert(ssss1); } </script> </head> <body> <textarea cols="50" rows="10" id="_ASPeditor"> <% 'The file name of this tag is tag_354_content.asp Sub tag_354_content() set objRs_tag_354_content=server.createobject("adodb.recordset") strSql="Select * from project354 where ID = "&Request("id")&"" objRs_tag_354_content.open strSql,conn,1,1 End Sub %> </textarea> <input name="" type="button" value="提取SQL" onclick="getSqlCode()"/> </body> </html>