regex for anything but quoted strings site:stackoverflow.com
/(\B(".+?")\B|\B('.+?')\B|\B(`.+?`)\B)/g;
regex for anything but quoted strings site:stackoverflow.com
/(\B(".+?")\B|\B('.+?')\B|\B(`.+?`)\B)/g;
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);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us