|
|
@ -131,6 +131,7 @@ public class TestRegex {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看一个字符串是否可以转换为数字
|
|
|
|
* 查看一个字符串是否可以转换为数字
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -145,6 +146,7 @@ public class TestRegex {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean leftMatch(String str) {
|
|
|
|
public static boolean leftMatch(String str) {
|
|
|
|
int ls = str.indexOf("(");
|
|
|
|
int ls = str.indexOf("(");
|
|
|
|
int rs = str.indexOf(")");
|
|
|
|
int rs = str.indexOf(")");
|
|
|
@ -216,7 +218,19 @@ public class TestRegex {
|
|
|
|
Matcher matcher = pattern.matcher(str);
|
|
|
|
Matcher matcher = pattern.matcher(str);
|
|
|
|
if (matcher.find()) {
|
|
|
|
if (matcher.find()) {
|
|
|
|
flag = true;
|
|
|
|
flag = true;
|
|
|
|
record.set("zhuanye", matcher.group(1));
|
|
|
|
String zhuanye = matcher.group(1);
|
|
|
|
|
|
|
|
String xz = "";
|
|
|
|
|
|
|
|
int xzStart = zhuanye.indexOf("(学制");
|
|
|
|
|
|
|
|
if (xzStart >= 0) {
|
|
|
|
|
|
|
|
int xzStop = xzStart;
|
|
|
|
|
|
|
|
while (xzStop < zhuanye.length() && String.valueOf(zhuanye.charAt(xzStop)) != ")") {
|
|
|
|
|
|
|
|
xzStop++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xz = zhuanye.substring(xzStart, xzStop);
|
|
|
|
|
|
|
|
zhuanye = zhuanye.replace(xz, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
record.set("zhuanye", zhuanye);
|
|
|
|
|
|
|
|
|
|
|
|
String xf = matcher.group(2);
|
|
|
|
String xf = matcher.group(2);
|
|
|
|
xf = xf.replace("r", "");
|
|
|
|
xf = xf.replace("r", "");
|
|
|
|
if (isStr2Num(xf.toString())) {
|
|
|
|
if (isStr2Num(xf.toString())) {
|
|
|
@ -224,7 +238,7 @@ public class TestRegex {
|
|
|
|
if (matcher.groupCount() >= 3) {
|
|
|
|
if (matcher.groupCount() >= 3) {
|
|
|
|
String memo = matcher.group(3);
|
|
|
|
String memo = matcher.group(3);
|
|
|
|
memo = changeMemo(memo);
|
|
|
|
memo = changeMemo(memo);
|
|
|
|
record.set("memo", memo);
|
|
|
|
record.set("memo", memo + xz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
record.set("xf", "学费待定");
|
|
|
|
record.set("xf", "学费待定");
|
|
|
@ -235,7 +249,7 @@ public class TestRegex {
|
|
|
|
//姜莹莹需求
|
|
|
|
//姜莹莹需求
|
|
|
|
memo.replace("(", "(");
|
|
|
|
memo.replace("(", "(");
|
|
|
|
memo.replace(")", ")");
|
|
|
|
memo.replace(")", ")");
|
|
|
|
record.set("memo", memo);
|
|
|
|
record.set("memo", memo + xz);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|