Answers for "regex for anything but quoted strings site:stackoverflow.com"

0

regex for anything but quoted strings site:stackoverflow.com

/(\B(".+?")\B|\B('.+?')\B|\B(`.+?`)\B)/g;
Posted by: Guest on January-11-2021
0

regex for anything but quoted strings site:stackoverflow.com

var rgx = /(\B(".+?")\B|\B('.+?')\B|\B(`.+?`)\B)/g;

var str = `"Lorem ipsum dolor sit amet", consectetur adipisicing elit, "'sed do eiusmod tempor,'" incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, \`quis nostrud\` exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. \`Duis aute irure dolor\` in "reprehenderit in voluptate" velit esse cillum 'dolore eu fugiat nulla' pariatur. `;

var sub = ``;

var res = str.replace(rgx, sub);

console.log(res);
Posted by: Guest on January-11-2021

Code answers related to "regex for anything but quoted strings site:stackoverflow.com"

Code answers related to "Javascript"

Browse Popular Code Answers by Language