The string format is similar to:
1) some question text
A)option
B) option
C) option
D) option
2) some question text.
A) option
B) option
C) option
D) option
etc..
I was trying to use regex to match each question (javascript):
/(d+[.)]s.*?)(?=s*d+[.)]|$)/gs
It works fine until the very last question.
With the |$ as part of the positive lookahead, it should select the last question until the end of the string, but it doesn’t (on regex101). Is there anything am I doing wrong?
New contributor
Roger Li is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.