(.*?)<\/span>/s', $line, $matches); if (isset($matches[1])) { echo "Code content:\n"; echo $matches[1] . "\n"; } break; } }