3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
38.37 ms | 402 KiB | 5 Q