匹配JSON的链接

时间:2018-02-14 16:59:26

标签: json regex string match

我有这个字符串。

{"videoID":"10156327104658120",
"playerFormat":"inline",
"playerOrigin":"newsfeed",
"external_log_id":null,
"external_log_type":null,
"rootID":"10156327104658120",
"playerSuborigin":"misc",
"canUseOffline":null,
"playOnClick":true,
"videoDebuggerEnabled":false,
"videoPlayerVisibilityBehavior":"2",
"videoViewabilityLoggingEnabled":false,
"videoViewabilityLoggingPollingRate":-1,
"videoPlayerPauseWhenBlur":false,
"videoScrollUseLowThrottleRate":true,
"playInFullScreen":false,
"type":"video",
"src":"https:\/\/video-frx5-1.xx.fbcdn.net\/v\/t42.1790-2\/28100902_1709246409132048_3547885085212540928_n.mp4?efg=eyJybHIiOjMwMCwicmxhIjo1MTIsInZlbmNvZGVfdGFnIjoic3ZlX3NkIn0\u00253D&oh=5ca37733bd3004fe2591152502e63def&oe=5A84637D","width":340,"height":340,"trackingNodes":"FH-R",
"downloadResources":null,
"subtitlesSrc":null,
"spherical":false,
"sphericalParams":null,
"animatedGifVideo":false,
"defaultQuality":null,
"availableQualities":null,
"playStartSec":null,
"playEndSec":null,
"playMuted":null,"disableVideoControls":false,"loop":false}

如何匹配" src"的值?键。

1 个答案:

答案 0 :(得分:-1)

使用的示例:

> var o = '{ "x": "foobar" }'
undefined
> var j = JSON.parse(o)
undefined
> j
{ x: 'foobar' }
> console.log(j.x)
foobar