JSFiddle - React, Tailwind, and code Playground JavaScript var s = "HeLLo World"; alert(s.replace(/hello/i, '<$&>'));