<?php $input = '1. Who was the first president of the United States of America? ANSWER: George Washington'; $regex = '/^(\d+)\.\s*(.+)ANSWER:\s+(.+)/m'; preg_match_all( $regex, $input, $matches); var_dump( $matches);
You have javascript disabled. You will not be able to edit any code.