行:
{"symbol":"ETHBTC","price":"0.03437400"}
代码:
SEARCH SOURCE=REGEXP:"\"ETHBTC\",\"price\":\"(.[^\"]*)\"" EXTRACT="$1"
-提取值“ 0.03437400”,效果很好。
但是我如何在这里提取0.00014137或0.00015999 从此代码
[{"cur":"BNT","symbol":"BNT/BTC","last":0.00015222,"high":0.00015714,"low":0.00014651,,"best_bid":0.00014137,"best_ask":0.00015999}
此值始终不同。
答案 0 :(得分:0)
我认为您可以尝试这样的事情:
SEARCH SOURCE=REGEXP:"\[\{\"cur\":\"BNT\",\"symbol\":\"BNT/BTC\".+\"best_bid\":([\d\.]+)" EXTRACT="$1"
SEARCH SOURCE=REGEXP:"\[\{\"cur\":\"BNT\",\"symbol\":\"BNT/BTC\".+\"best_ask\":([\d\.]+)" EXTRACT="$1"
PROMPT {{!EXTRACT}}