Answer the question
In order to leave comments, you need to log in
How to find and replace a string without case sensitivity?
I know how to search. But here's how to replace the original no
function replace (str) {
var mask = 'сан'
return str.replace(new RegExp(mask, 'gi'), '<strong> + mask +</strong>')
}
replace('Санкт-Петербург');
// <strong>сан</strong>кт-петербург
// а нужно // <strong>Cан</strong>кт-петербург
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question