Say, I use the following code

let reg = new RegExp(`((?:[а-яА-Я]*)(?:${fields.search})(?:[а-яА-Я]*))`, 'g'); 

as a result, the babel transports it into such a mess

 var reg = new RegExp("((?:[\u0430-\u044F\u0410-\u042F]*)(?:" + fields.search + ")(?:[\u0430-\u044F\u0410-\u042F]*))", 'g'); 

because of what a regular function does not work correctly. Can anyone come across this? Tried to find about the Cyrillic alphabet on the site babeljs.io, found nothing

  • Javascript + Unicode regexes - Stanislav Grotto
  • Thank you very much! It helped! - Vadim Milevsky
  • 2
    @StanislavGrot Please try to publish detailed answers containing a specific example of the minimum solution, supplementing them with a link to the source. Answers –references (like comments) do not add knowledge to Runet. - Nicolas Chabanovsky

0