JSFiddle - React, Tailwind, and code Playground

by rgthree

JavaScript

var rgx = /^([^\n]*?)'/g;
var str = " ('First Name', 'Last Name')\n ('Thomas', 'Jenkins')\n ('Samuel', 'Adams')";
var matches;
while ((matches = str.match(rgx)) !== null) {
  str = str.replace(matches[0], matches[0].replace(/'/, '"'))
}

$('body').html('<pre>' + str + '</pre>');