I am working on some code to break down the full text of a test that will copied and pasted with the following format:
1. This is question number one.
A. Answer 1
B. Answer 2
C. Answer 3
D. Answer 4
2. This is question number two.
3. This is another question, number three.
45. Ken has uses his money, $353. How much does he have after spending $214.
I am using the following preg_split:
$questions = preg_split("/[0-9]+\./", $_POST[test]);
My problem has come in with questions like #45 where there are numbers in the question itself and they are followed by a period.
I just want to match the numbers 1-100 followed by a period. Eg.
1. 2. 3. 4. 5. etc
I think it is better to use
multiline
flag with^
: