Answer the question
In order to leave comments, you need to log in
`
Regular expression in Firefox, what's wrong?
Good afternoon,
Please help. Very simple code to replace double quotes "" with "".
Here is the code:
var str = `asdffsafd sdfsf, 7 sdf<br>asdfsfaf С.Я.afdsdfaf "asdf asfdasfsaf"<br>
"La <br> lala," "A fdfdfd, А fdfdfd<br>
fdff df dfdfdf dfdfdf, "<br> adffsdf asdfdsfsadf asdfdf adfadsff`;
var changeDoubleQuotes = function (str) {
var regExp1 = /\n/g;
var _str = str.replace(regExp1, ``);
var regExp = /"(?<name>.+?)"/img;
return _str.replace(regExp, `«$<name>»`);
};
console.log(changeDoubleQuotes(str));
Answer the question
In order to leave comments, you need to log in
var str = `asdffsafd sdfsf, 7 sdf<br>asdfsfaf С.Я.afdsdfaf "asdf asfdasfsaf"<br>
"La <br> lala," "A fdfdfd, А fdfdfd<br>
fdff df dfdfdf dfdfdf, "<br> adffsdf asdfdsfsadf asdfdf adfadsff`;
var changeDoubleQuotes = function (str) {
return str.replace(/"([\s\S]*?)"/g, '«$1»');
};
console.log(changeDoubleQuotes(str));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question