3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = " XYZ99 Some text XYZ99. XYZ13 Some text XYZ33 and some text XYZ13. XYZ45 "; var_dump( preg_match_all('/^XYZ\d{2}$/m', $subject, $matches), $matches );

preferences:
31.32 ms | 402 KiB | 5 Q