I just want the numbers of a text

Hi!

I just want the numbers (479,70 and 383,90) using Regex. Can you help me?
image

Is it possible to have the result of (*1-(383,90/479,70))*100) using Regex? I mean, the discount (19,97%)?

Thank you in advance!

Assuming the numbers are always preceded by Normal: and Special Price:, you can get them with the regex below.

(?<=Normal:) ?[\d\,]+

(?<=Special Price:) ?[\d\,]+

For calculations, you would need to post-process with Excel, Sheets or Python. Very common task, try google or youtube.

1 Like

Thank you!

I changed the regex a little bit to include a number like 1 149,99, for example. I would like to know if it is possible to remove the space (1149,99).

image

(?<=Price) ?[\d^\s]+[\d\,]+)

@gitassinari Hi.

For that, you can use the Web Scraper Cloud parser feature.

https://webscraper.io/documentation/web-scraper-cloud/parser

Just press the spacebar in the 'Text to replace' field and leave 'Text to place' empty.

1 Like