JSFiddle - React, Tailwind, and code Playground

HTML

<p>Running sprinklers , twice, on Sunday, 17 May, and their address is an Odd number. Water went into the street, for about an hour, both times.</p>

CSS

section{
        width:10px;
        float:left;
        font:14px;
    }
    .first-two-words2 { 
        font-style:italic;
        white-space: nowrap;
    }

JavaScript

$('p').html(function (i, html) {
    return html.replace(/(\w+\s\w+)/, '<span class="first-two-words2">$1</span>')
});