|
@@ -517,19 +517,39 @@ public class TElQuController extends BaseController {
|
|
|
} else {
|
|
|
System.out.println("未找到匹配的内容");
|
|
|
}
|
|
|
- if (quStr.contains("E.")) { //有E选项
|
|
|
-
|
|
|
- Pattern patternE = Pattern.compile("E\\.(.*?)(?=\\[D])");
|
|
|
- Matcher matcherE = patternE.matcher(quStr);
|
|
|
- if (matcherE.find()) {
|
|
|
- String content = matcherE.group(1);
|
|
|
- System.out.println("从E、到[D]、之间的内容是: " + content);
|
|
|
- answerE.setContent(content);
|
|
|
- } else {
|
|
|
- System.out.println("未找到匹配的内容");
|
|
|
- }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (quStr.contains("E.")) { //有E选项
|
|
|
+ Pattern patternC = Pattern.compile("C\\.(.*?)D\\.");
|
|
|
+ Matcher matcherC = patternC.matcher(quStr);
|
|
|
+ if (matcherC.find()) {
|
|
|
+ String content = matcherC.group(1);
|
|
|
+ System.out.println("从C、到D、之间的内容是: " + content);
|
|
|
+ answerC.setContent(content);
|
|
|
+ } else {
|
|
|
+ System.out.println("未找到匹配的内容");
|
|
|
}
|
|
|
- } else {//无D选项
|
|
|
+ Pattern patternD = Pattern.compile("D\\.(.*?)E\\.");
|
|
|
+ Matcher matcherD = patternD.matcher(quStr);
|
|
|
+ if (matcherD.find()) {
|
|
|
+ String content = matcherD.group(1);
|
|
|
+ System.out.println("从D、到E、之间的内容是: " + content);
|
|
|
+ answerD.setContent(content);
|
|
|
+ } else {
|
|
|
+ System.out.println("未找到匹配的内容");
|
|
|
+ }
|
|
|
+
|
|
|
+ Pattern patternE = Pattern.compile("E\\.(.*?)(?=\\[D])");
|
|
|
+ Matcher matcherE = patternE.matcher(quStr);
|
|
|
+ if (matcherE.find()) {
|
|
|
+ String content = matcherE.group(1);
|
|
|
+ System.out.println("从E、到[D]、之间的内容是: " + content);
|
|
|
+ answerE.setContent(content);
|
|
|
+ } else {
|
|
|
+ System.out.println("未找到匹配的内容");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!quStr.contains("D.")) {//无D选项
|
|
|
Pattern patternC = Pattern.compile("C\\.(.*?)(?=\\[D])");
|
|
|
Matcher matcherC = patternC.matcher(quStr);
|
|
|
if (matcherC.find()) {
|