首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

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

2011-12-28 
java代码正则表达式替换的问题Java codesql update tour set sql + Link_Tel?,sql + View_Nam

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次,测试成功,放心使用吧

热点排行