- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?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);