I am trying to understand why in this snippet, for a given string
عروض تبدأ من $minprice
I get
عروض تبدأ من $5821
back :(
Any help would be much appreciated! Thanks :)
var regExp = new RegExp(/\$minprice/, 'ig');
var string = "عروض تبدأ من $minprice";
console.group();
console.log(
"new string",
string.replace(regExp, (matched, offset, originalString) => {
console.log('originalString', originalString);
return '$5821';
})
);
console.groupEnd();