'How to filter by Regex in LibreOffice?

I've got this string:

{"success":true,"lowest_price":"1,49€","volume":"1,132","median_price":"1,49€"}

Now I want the value for median_price being displayed in a cell. HHow can I achive this with Regex?

With regex101.com I've came to this solution:

(?<=median_price":")\d{0,4},\d{2}€

But this one does not seem to be working in LibreOffice calc.



Solution 1:[1]

I'd advise to discard the Euro-symbol at first since you'd probably want to retrieve a value to calculate with, a numeric value. Therefor try:

enter image description here

Formula in B1:

=--REGEX(A1;".*median_price"":""(\d+(?:,\d+)?)€.*";"$1")

The double unary will transform the result from the 1st capture group into a number. I then went ahead and formatted the cell to display currency (Ctrl+Shift+4).


Note: I went with a slightly different regular pattern. But go with whatever works for your data I supppose.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JvdV