JSFiddle - React, Tailwind, and code Playground

by mckabue

JavaScript

function quoteRegExp(string) {
            return string.replace(/[\\\[\]\^$*+.()|{}]/g, "\\$&");
        }
        
        console.log(quoteRegExp('/hv/hb?fc=ff'))