- preg_replace: documentation ( source)
<?php
$string = 'HP ProBook 450 G5 15.6 inch i5-8250U - 4LT51EA#ABB - Black';
$find = array('/\s+inch\s+(i[357])-\w+/', '/(\w+)#\w+/');
$replace = array('" $1', '$1');
$result = preg_replace($find, $replace, $string);
echo $result;