I'm looking for solution to change all img tags where is src imgur. I have try this and generaly this is working, but problem can be if imgur change their subdomain in this case this regex wont work.
So to be more clear i just need to add class name too all images hosted on imgur.
$string = 'I have been searching <img src="https://i.imgur.com/NknpNdu.jpg" alt=""> for...';
$regex = '#<img src="https://i.imgur.com([^"/]*/?[^".]*\.[^"]*)"([^>]*)>#';
$replace = '<img class="newClass" src="https://i.imgur.com/$1">';
$Content = preg_replace($regex, $replace, $string);