|
@@ -44,15 +44,15 @@ def option2block(option_con, item_no_type):
|
|
while re.search(r"(\n\s*<img\s*src=.+?)([A-H][..、、])(.+?)", con.replace(" ", "")):
|
|
while re.search(r"(\n\s*<img\s*src=.+?)([A-H][..、、])(.+?)", con.replace(" ", "")):
|
|
con = re.sub(r"(\n\s*<img\s*src=.+?)(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1" + "\n" + r"【【\2】】\3", con)
|
|
con = re.sub(r"(\n\s*<img\s*src=.+?)(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1" + "\n" + r"【【\2】】\3", con)
|
|
while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-Hc][..、、])\n+(.+?)(?<!【)([A-H][..、、])(.+?)",
|
|
while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-Hc][..、、])\n+(.+?)(?<!【)([A-H][..、、])(.+?)",
|
|
- con.replace(" ", ""), re.S):
|
|
|
|
|
|
+ con.replace(" ", ""), flags=re.S):
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])\s*\n+(.+?)"
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])\s*\n+(.+?)"
|
|
r"(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1【【\2】】\3【【\4】】\5", con, flags=re.S)
|
|
r"(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1【【\2】】\3【【\4】】\5", con, flags=re.S)
|
|
- while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-H][..、、])\n+(.+?)", con.replace(" ", ""), re.S):
|
|
|
|
|
|
+ while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-H][..、、])\n+(.+?)", con.replace(" ", ""), flags=re.S):
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])\s*\n+(.+?)",
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])\s*\n+(.+?)",
|
|
r"\1【【\2】】\3", con, flags=re.S)
|
|
r"\1【【\2】】\3", con, flags=re.S)
|
|
- while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-H][..、、])(.+?)", con.replace(" ", "")):
|
|
|
|
- con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1【【\2】】\3", con)
|
|
|
|
- while re.search(r"(\n【【[A-H][..、、]】】[^【]+?/>\s+)(?<!【)([B-H][..、、])(.+?)", con.replace(" ", ""), re.S):
|
|
|
|
|
|
+ while re.search(r"(\n【【[A-H][..、、]】】.+?)(?<!【)([A-H][..、、])(.+?)", con.replace(" ", ""), flags=re.S):
|
|
|
|
+ con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】.+?)(?<!【)([A-H]\s*[..、、::])(.+?)", r"\1【【\2】】\3", con, flags=re.S)
|
|
|
|
+ while re.search(r"(\n【【[A-H][..、、]】】[^【]+?/>\s+)(?<!【)([B-H][..、、])(.+?)", con.replace(" ", ""), flags=re.S):
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】[^【]+?/>\s+)(?<!【)([B-H]\s*[..、、::])\s*(.+?)",
|
|
con = re.sub(r"(\n\s*【【[A-H]\s*[..、、]】】[^【]+?/>\s+)(?<!【)([B-H]\s*[..、、::])\s*(.+?)",
|
|
r"\1【【\2】】\3", con, flags=re.S) # 选项子母前面是图片 9/8
|
|
r"\1【【\2】】\3", con, flags=re.S) # 选项子母前面是图片 9/8
|
|
if item_no_type == 2:
|
|
if item_no_type == 2:
|
|
@@ -100,6 +100,7 @@ def option_structure(one_item, con, ans, item_no_type, is_danti=0):
|
|
return one_item
|
|
return one_item
|
|
|
|
|
|
ans = re.sub("[;;.]+", "", ans)
|
|
ans = re.sub("[;;.]+", "", ans)
|
|
|
|
+ ans = re.sub("<[a-z]+ (style|rowspan|colspan|class)=[^<>]*?\">|</[a-z]+>", "", ans)
|
|
ans2 = []
|
|
ans2 = []
|
|
for a in ans.split("#"):
|
|
for a in ans.split("#"):
|
|
if 0 < len(a.replace(" ", "")) < 8:
|
|
if 0 < len(a.replace(" ", "")) < 8:
|