服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - 正则表达式 - 用正则实现提取代码内容的代码

用正则实现提取代码内容的代码

2020-07-14 20:42正则之家 正则表达式

研究了一个下午,没有头绪,来论坛求助,老ID丢了!重新注册了一个!=。=! 我想用javascript正则提取asp代码中SQL行的表达式但是写来写去都不行,各位辛苦帮忙看看! 想提取引号中的SQL表达式 strSql=Select * from project354 where ID = Request(

研究了一个下午,没有头绪,来论坛求助,老ID丢了!重新注册了一个!=。=!

我想用javascript正则提取asp代码中SQL行的表达式但是写来写去都不行,各位辛苦帮忙看看!

想提取引号中的SQL表达式

strSql="Select * from project354 where ID = "&Request("id")& and Name='111'" 

  1. <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>  

 

延伸 · 阅读

精彩推荐