研究了一個下午,沒有頭緒,來論壇求助,老ID丟了!重新注冊了一個!=。=!
我想用javascript正則提取asp代碼中SQL行的表達式但是寫來寫去都不行,各位辛苦幫忙看看!
想提取引號中的SQL表達式
strSql="Select*fromproject354whereID="&Request("id")&andName='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>
新聞熱點
疑難解答