【发布时间】:2015-10-06 22:38:13
【问题描述】:
我正在使用正则表达式来查找答案选择及其描述。 到目前为止,它运行良好,但问题是我无法弄清楚如何在不包含下一个选项的情况下包含多行描述。
我当前的正则表达式:
^(Choice [A-I] \(.*\) +(?:is incorrect. )?($|\r?.*))
测试用例:
Choice B (Predominance of eosinophils) zfdfdfbhdfdfdf
fgdfgdfgdfdfdfhd fgdfgdfgdsgsf
sgsgdfgdf gdfgdfgdfgdfgd gdfg
Choice C (Monosodium urate crystals) fghfdghfghfghfh
Choice D (Spirochetes) is incorrect fghfghfghfghfghf
Choice E (Predominance of polymorphonuclear cells)
我需要选择 B 之后的两个随机文本句子也包含在选择 B 匹配中,但不包括选择 C。
【问题讨论】:
标签: javascript regex text