I'm working in the Adobe ExtendScript environment (Javascript) trying to match a section from a string, but nothing I try seems to work. Here's an example of the string:
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
I want to be able to match an entire question and answer bit, so from 'Qx' until the next instance of Q (or Qx+1).
Every RegExp I try either just gets the question line, or returns null
.
Any help with a solution MUCH appreciated, I still haven't cracked Reg Exp's yet clearly .