(G1102_0690_C10_1+G1102_0690_C32_1+G1102_0690_C37_1+G1102_0690_C60_1+G1102_0690_C63_1+G1102_0690_C66_1+G1102_0690_C69_1)/(G1102_0690_F70_1*0.02+G1102_0690_H70_1*0.25+G1102_0690_I70_1*0.5+G1102_0690_J70_1)&(G1102_0690_C10_2+G1102_0690_C32_2+G1102_0690_C37_2+G1102_0690_C60_2+G1102_0690_C63_2+G1102_0690_C66_2+G1102_0690_C69_2)/(G1102_0690_F70_2*0.02+G1102_0690_H70_2*0.25+G1102_0690_I70_2*0.5+G1102_0690_J70_2)&(G1102_0690_C10_3+G1102_0690_C32_3+G1102_0690_C37_3+G1102_0690_C60_3+G1102_0690_C63_3+G1102_0690_C66_3+G1102_0690_C69_3)/(G1102_0690_F70_3*0.02+G1102_0690_H70_3*0.25+G1102_0690_I70_3*0.5+G1102_0690_J70_3)
以上是字符串,我要验证的是:
除了0-9 a-z A-Z () [] {} + - * / (其他都不允许存在)
&在整个字符串中必须出现两次.
--------------------------------
以下内容为自动编辑的内容,并非楼主的发贴内容,此仅用于显示而已,并无任何其他特殊作用
楼主【dingli123】截止到2008-08-05 16:08:49的历史汇总数据(不包括此帖):
发帖的总数量:1 发帖的总分数:100 每贴平均分数:100
回帖的总数量:2 得分贴总数量:1 回帖的得分率:50%
结贴的总数量:1 结贴的总分数:100
无满意结贴数:0 无满意结贴分:0
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:0.00 % 无满意结分率:0.00 %
敬礼!
取消马甲机器人,请点这里:http://www.java2000.net/mycsdn/robotStop.jsp?usern=dingli123
------解决方案--------------------
((\([\w\+\-\*\/\.]+\))/(\([\w\+\-\*\/\.]+\))&){2}(\([\w\+\-\*\/\.]+\))/(\([\w\+\-\*\/\.]+\))
java中\换成\\
------解决方案--------------------
第一个有点问题,
- Java code
public static boolean do10() { String str = "123+-*/()[]{}abAb&&"; Pattern pattern = Pattern.compile("([^0-9a-zA-Z\\+\\-\\*\\/\\(\\)\\[\\]\\{\\}&])",Pattern.CASE_INSENSITIVE | Pattern.DOTALL); Matcher m = pattern.matcher(str); while (m.find()) { System.out.println(m.group(1)); return true; } Pattern pattern2 = Pattern.compile("(\\&)",Pattern.CASE_INSENSITIVE | Pattern.DOTALL); Matcher m2 = pattern2.matcher(str); int getit=0; while(m2.find()){ getit++; } if(getit!=2){ System.out.println("getit="+getit); return true; } return false; }