Использование Международный :
const str = "Price starting from Rs.100000",
str2 = "Price starting from Rs.100,000",
str3 = "Pricing starts at Rs.50000000 and get 20% discount, if you order now!";
[str, str2, str3].forEach(str=>{
const [,prefix, num, suffix] = str.match(/(.*?Rs\.)([\d,]+)(.*)$/);
const fNum = new Intl.NumberFormat('en-IN').format(num.replace(/,/g,''));
console.info(`${prefix}${fNum} ${suffix}`);
})
В качестве альтернативы используйте положительный взгляд с помощью string.replace:
const str = 'Price starting from Rs.100000',
str2 = 'Price starting from Rs.100,000',
str3 =
'Pricing starts at Rs.50000000 and get 20% discount, if you order now!';
[str, str2, str3].forEach(str => {
const formatted = str.replace(/(?<=Rs\.)[\d,]+/, num => {
return new Intl.NumberFormat('en-IN').format(num.replace(/,/g, ''));
});
console.info(formatted);
});