我在 Adobe ExtendScript 环境 (Javascript) 中工作,试图匹配字符串中的一个部分,但我尝试的任何方法似乎都不起作用。这是字符串的示例:
Q1: Question 1: this is the first question?
- Answer bit
- Answer bit
- Answer bit
Q2: Question 2: this is the second question?
- Answer bit
- Answer bit
- Answer bit
Q3: Question 3: this is the third question?
- Answer bit
- Answer bit
- Answer bit
我希望能够匹配整个问答位,所以从“Qx”到 Q 的下一个实例(或 Qx+1)。我尝试的每个 RegExp 要么只是得到问题行,要么返回null
.
非常感谢任何有关解决方案的帮助,我还没有清楚地破解 Reg Exp。