如何在Libreoffice中通过Regex过滤?
我已经有一个字符串:
{"success":true,"lowest_price":"1,49€","volume":"1,132","median_price":"1,49€"}
现在,我希望在单元格中显示Median_price的值。我可以用正则表达式实现这一目标吗?
有了Regex101.com,我来了这个解决方案:
(?<=median_price":")\d{0,4},\d{2}€
但是这个解决方案似乎在libreoffice calc中工作。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议首先丢弃欧元符号,因为您可能想检索一个数值值来计算的值。因此尝试:
b1
中的公式:双UNARY将将结果从第一个捕获组转换为一个数字。然后,我继续格式化单元格以显示货币( ctrl + shift + 4 )。
注意:我的常规图案略有不同。但是,请使用我支持的任何有用的数据。
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:
Formula in
B1
: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.