这个文件是 json文件的格式 如何用正则表达式把 url地址解析出来 就是把黑体的链接输出出来
"url":**_"/publications-news/news/2020-04-17/doolittle-raid-78th-anniversary"_**
我是这样写的 但是url输出不出来
#encoding:utf-8
$stdout.sync = true
require 'nokogiri'
url = "https://www.afa.org/publications-news/news/_jcr_content/content/news.news.json"
agent = '-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"'
code =curl.exe -s #{agent} -c cookies.txt -k -L "#{url}" -e "https://www.afa.org/publications-news/news"
info = code.force_encoding("UTF-8")
doc = Nokogiri::HTML(code.force_encoding("UTF-8"))
File.new("w.html","w").puts code
array_list = info.scan(/title.*?/im)
for i in 0..array_list.size-1
url= array_list [i]**[/"url":"(.*?)"/,1]**.to_s
puts "[Url]:#{url}\n"
end
谁能帮我看看怎么写