1
の一部を見つけるために正規表現とは何ですか:私は、このJSONの部分を持っているJSON
{
"destination_addresses":[
"8000 AA Zwolle, Nederland"
],
"origin_addresses":[
"8100 AA Heino, Nederland"
],
"rows":[
{
"elements":[
{
"distance":{
"text":"14,6 km",
"value":14555
},
"duration":{
"text":"17 min.",
"value":1022
},
"status":"OK"
}
]
}
],
"status":"OK"
}
私はではなく、この番号を検索して(常に数字ので、正規表現は、値14555と値1022を見つけたいです変更)がノードで検索(距離と距離値の値)
アイデア?
なぜオブジェクトに変換して値を取得できないのですか? – Garfield
可能な複製:http://stackoverflow.com/questions/20916699/regular-expression-to-extract-json-string-from-text – McNets
/[0-9] +(?= \ s * \})/ g – youssouf