$re = '/BEGIN:VEVENT.*?SUMMARY:(HMIN105M|HMSN118|HMIN121M|HMIN122M).*?END:VEVENT/s';
$str = 'BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//ADE/version 6.0
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20241023T155849Z
DTSTART:20241023T111500Z
DTEND:20241023T124500Z
SUMMARY:MECA-S1-CM
LOCATION:B42 - Amphi N (003)
DESCRIPTION:\\\\n\\\\nCM/TD/TP tout Cycle prépa 1\\\\nAUCHE Doriane\\\\n\\\\n(Modifié le
:31/05/2024 14:00)
UID:ADE60456d706c6f6973647574656d7073323032342d323032352d36333237302d302d
34
CREATED:19700101T000000Z
LAST-MODIFIED:20240531T120000Z
SEQUENCE:2141269420
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20241023T155849Z
DTSTART:20241025T111500Z
DTEND:20241025T124500Z
SUMMARY:TD ATO-S1 GR A
LOCATION:B41 - 003
DESCRIPTION:\\\\n\\\\nTD GR A Cycle prépa 1\\\\nCHENU Sebastien\\\\n\\\\n(Modifié le:03/
06/2024 11:55)
UID:ADE60456d706c6f6973647574656d7073323032342d323032352d3837332d31312d30
';
$subst = "";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php