skip to Main Content

Anyone can help me with this regular expression? I need to extract the price from a list of items.

<span class="woocommerce-Price-amount amount"><bdi>22,21<span class="woocommerce-Price-currencySymbol">&euro;</span></bdi></span>.

I found this, but I am not extracting the ",".

=REGEXREPLACE(H8;"D+"; "")*1

2

Answers


  1. You can use

    =REGEXEXTRACT(H8;"(d[d,]*)<spans+class="woocommerce-Price-currencySymbol">&euro;")
    

    See the regex demo.

    Details

    • (d[d,]*) – Capturing group 1 (the group value is the return value of the REGEXEXTRACT function): a digit and then any zero or more digits or commas
    • <spans+class="woocommerce-Price-currencySymbol">&euro; – a literal string with any one or more whitespaces between the tag name and the class attribute.
    Login or Signup to reply.
  2. try:

    =REGEXEXTRACT(A1, "d+,d+")
    

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search