I have a problem with my regex, I just need to quote only the price of the products from this string, I used this Regex but it did not help me, can anyone fix it? Thank you
A word from which I only need 69
LEUWIN 4XL CHF 69.–
my try:
var re = /[0-9]{2}/;
I take it from this field (picture below)
It works for me in all cases except in this one
so far I have used this regex in function, but now I only read the first number so I have to replace, otherwise the price and the number are always the same
function calculateSumWithInput(e) {
var re = /\d+/;
var value = re.exec(e.target.value);
if (value && !isNaN(value) && Number(value) === parseInt(value, 10)) {
sum = parseInt(value, 10);
finalInput.value = "CHF " + sum + ".–";
}
}
thank you all for help


/\b[A-Z]{3}\d+\b/./\b[A-Z]{3}\s?\d+\b/?/\b[A-Z]{3}\s?\d{2}\b/?\d+(?=\.\–)