JSFiddle - React, Tailwind, and code Playground

by Ken Z

HTML

<p>Text and numbers: 123</p>
<p>123 and text</p>

CSS

span {
    color:blue
}

JavaScript

$('p').html(function(index, value) {
    return value.replace(/(\d+)/g, '<span>$1</span>');
});