My regex is not so hot so apologies for the very newb question.
I’m using String.replace to change the string “../../libs/bootstrap/less” into just “bootstrap”. Currently my regex looks like this:
myString.replace(\.\.\/\.\.\/libs\/bootstrap\/less/g, 'bootstrap);
I figure there has to be a better way to escape that path. Is it possible to specify a whole block of stuff to be escaped like /\”../../foo/bar/baz”/ ?
As far as I am aware, there is no global/block escape in regex. If you wanted to avoid the escaping in this instance you could alternatively do the following:
. and / don’t need to be escaped when specified within a character set []