I found a function online which appears similar to what you are looking for and tested it by creating two span classes instead of the single span from their example.
Then I played around with CSS for the two classes. You can test it, too if you want.
function replace_content($content) {
$content = str_replace('acmeproduct',
'<span class="acme-style">acme</span>
<span class="product-style">product</span>'
,$content);
return $content;
}
add_filter('the_content','replace_content');
span.acme-style {
display: inline;
font-style: italic;
text-transform: lowercase;
}
span.product-style {
display: inline;
font-style: normal;
text-transform: capitalize;
}
]]>