JSFiddle - React, Tailwind, and code Playground

JavaScript

var str = ":''>";
alert(str.replace(/([<>*()?])/g, "\\$1"));