<?php
$html = "The quick brown fox jumps over the lazy dog";
$replace = preg_replace('/\A(.*?)(brown fox)(.*?)\z/sim', '$1<span STYLE="font-size: x-large; color: #ffffff">$2</span>$3', $html); echo $replace;
// The quick <span STYLE="font-size: x-large; color: #ffffff">brown fox</span> jumps over the lazy dog
CTw/cGhwCgkKCSRodG1sID0gIlRoZSBxdWljayBicm93biBmb3gganVtcHMgb3ZlciB0aGUgbGF6eSBkb2ciOwoJJHJlcGxhY2UgPSBwcmVnX3JlcGxhY2UoJy9cQSguKj8pKGJyb3duIGZveCkoLio/KVx6L3NpbScsICckMTxzcGFuIFNUWUxFPSJmb250LXNpemU6IHgtbGFyZ2U7IGNvbG9yOiAjZmZmZmZmIj4kMjwvc3Bhbj4kMycsICRodG1sKTsKCWVjaG8gJHJlcGxhY2U7CgkvLyBUaGUgcXVpY2sgPHNwYW4gU1RZTEU9ImZvbnQtc2l6ZTogeC1sYXJnZTsgY29sb3I6ICNmZmZmZmYiPmJyb3duIGZveDwvc3Bhbj4ganVtcHMgb3ZlciB0aGUgbGF6eSBkb2cK