【问题标题】:Extracting hyperlinks from an RSS feed with Yahoo Pipes使用 Yahoo Pipes 从 RSS 提要中提取超链接
【发布时间】:2013-01-23 02:23:52
【问题描述】:

我想使用 Yahoo Pipes 过滤来自网络漫画 RSS 提要的描述并提取具有特定链接文本的所有链接。例如,对于文本“本章从这里开始”和包含以下内容的描述:

<a href="http://example.com/1234.html">This chapter began here</a>.
<a href="http://cuteoverload.com/">Here are some great kitten pictures</a>

我希望输出是

http://example.com/1234.html

我最好的猜测是这将涉及一个正则表达式,但经过 45 分钟的研究,我不确定从哪里开始。我没有看到如何使用正则表达式来提取文本,而不仅仅是替换它。

【问题讨论】:

    标签: yahoo-pipes


    【解决方案1】:

    正则表达式应该可以解决问题。

    A) “替换”参数

    (.*<a href=")(http://example\.com/[^"]*)(.*) 
    

    将描述分成三部分

    (.*<a href=")
    (http://example\.com/[^"]*)
    (.*)
    

    B) “With”参数用第二部分替换整个描述

    $2
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多