当前位置: 代码迷 >> J2EE >> java代码正则表达式替换的有关问题
  详细解决方案

java代码正则表达式替换的有关问题

热度:174   发布时间:2016-04-22 03:11:31.0
java代码正则表达式替换的问题
Java code
sql = "update tour set ";                sql += "Link_Tel=?,";                sql += "View_Name=?,";                sql += "Ticket_express_Service=?,";                sql += "Line_Area=?,";                sql += "View_Intro='" + all.getView_Intro() + "',";                sql += "Service_Item='" + all.getService_Item() + "',";                sql += "View_Ticket='" + all.getView_Ticket() + "',";                sql += "View_Kind='" + all.getView_Kind() + "',";                sql += "Open_Time='" + all.getOpen_Time() + "',";                sql += "Agency_Grade='" + all.getAgency_Grade() + "',";                sql += "View_Line='" + all.getView_Line() + "',";                sql += "Ticket_booking_Service='"                        + all.getTicket_booking_Service()                        + "',";                sql += "View_Grade='" + all.getView_Grade() + "',";                sql += "View_Facility='" + all.getView_Facility() + "',";


我需要把其中的 '" + all.*** + "', 通通换成 ?,

myeclipce里面怎么写替换规则?

------解决方案--------------------
'"[ ]*\+[ ]*all\..*\(\)[ ]*\+[ ]*"'
------解决方案--------------------
'"[ ]*\+[ ]*all\..*\(\)[ ]*\+[ ]*"'从你的sql代码中match出9次,测试成功,放心使用吧
  相关解决方案