Catch a block of code separated by 4 four backticks (as the markdown syntax).
Example to be adapted easily.
]*(.*?)````/';
preg_match($reg, $str, $matches);
echo $matches[0];
/* OUTPUT
````
h5 {
font-size: 1rem;
font-weight: 600;
}
````
*/
echo preg_replace($reg, "DELETED", $str);
/* OUTPUT
# Some Text
DELETED
And some text.
*/