I have some text I am trying to use regexes on. I need to make a match on numbers with % sign which are surrounded by arabic text. I have some regexes that look like this:
const re1 = new RegExp('\\d*,\\d*%');
const re2 = new RegExp('%\\d*,\\d*');
I have some text that looks like this:
%9,2 ملمول/مول 77 أو
I would expect the second regex to match the text but it is the first one that matches the text. Im sure there is a good reason for it, but I did not see anything in documentation about this. Why does it do this? What is the correct way to match a number with percent sign that is embedded in arabic text?