This looks like an easy task but I'm not being able to achieve it with LibreOffice Calc REGEX formulas.
I have a bunch of exams, each one with 20 multiple choice questions in this format:
1. Which of the following statements about producers is false?
a. Households produce many goods and services for themselves.
b. People set up some producers who do not aim to make profits.
c. All the goods and services consumed in any country are produced by its own producers.
d. Governments arrange the production of some goods and services.
Some questions have several paragraphs with new line characters in between. What I want to achieve is to capture/extract each one of these strings (question / answer a / answer b / answer c / answer d) using REGEX in LibreOffice. The idea is having one REGEX for each string to separate the info in different cells like this: libreoffice sheet example
For now I managed to do the matching with an online regex tester: https://regex101.com/r/jhfr63/1
To capture the question string: (^\d+\.[\S\s]+?(?=^a\.))
And to capture for instance answer "a": (^a.[\S\s]*?(?=^b\.))
I haven't had any luck doing the same with LibreOffice REGEX, so I'd need some help if possible. After changing the above regex the best I could achieve was to extract the question, but it only works for the first match, and I'm not too sure how it works:
=REGEX(A1,"^\d+\.[\S\s]*(?=\b[a]\.)",,1)