I will need a regex that escapes or captures (if not escaped) ALL double-quote characters INSIDE a single quote and then converts open single quotes to double quotes!
We are refactoring files that have many (and I mean many!) Single quotes in PHP or JS files. The only thing they have in common is that the lines are in at least one line and are summarized in = in both languages.
I will give an example (an example is an ugly outdated code, so don’t judge it, I already did it :)) We have a file that starts as follows:
var baseUrl = $("#baseurl").html();
var head = '<div id="finishingDiv" style="background-image:url({baseUrl}css/userAd/images/out_main.jpg); background-repeat: repeat-y; ">'+
'<div id="buttonbar" style="width:810px; text-align:right">';
and I want it to look like this:
var baseUrl = $("#baseurl").html();
var head = "<div id=\"finishingDiv\" style=\"background-image:url({baseUrl}css/userAd/images/out_main.jpg); background-repeat: repeat-y; \">" +
"<div id=\"buttonbar\" style=\"width:810px; text-align:right\">";
, .
, : ( ) ( ).
'.*(").*' '[^']*(")[^']*' " ". , , , .
, IDE, , .
, , , .