3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = " \\begin{verbatim} dupa zbita \\end \\end{verbatim} I chuj!!! \\end{verbatim}"; $str = preg_replace('/\\\\begin\s*\{verbatim\}.*\\\\end\s*\{verbatim\}/', 'VERBATIM', $str); echo $str;

preferences:
34.84 ms | 402 KiB | 5 Q