标签: ruby-on-rails regex http rest-client
我不确定如何选择带正则表达式的图像链接。我已经尝试过去一小时但没有运气。
我正在尝试选择的响应正文:https://gist.githubusercontent.com/anonymous/53971b49d783b90bf4b997b197ca3ee3/raw/c2a1f7c53ba89d67970ef8222bf5bf456c1679dd/gistfile1.txt
尝试选择“http://img-ineed.com/adsfasdf.jpg”。
谢谢。
答案 0 :(得分:0)
您可以使用:
string.match(/(https?:\/\/.*\.(?:png|jpg))/i)