Question

I would like to filter the descriptions from a webcomic RSS feed and extract all links with a specific link text, using Yahoo Pipes. For example, for the text "This chapter began here" and a description containing the following:

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

I would want the output to be

http://example.com/1234.html

My best guess is that this will involve a regex, but after 45 minutes of research I'm not really sure where to begin. I'm not seeing how to use a regex to extract text rather than just replacing it.

Was it helpful?

Solution

A regex should do the trick.

A) The "Replace" argument

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

to cut the description in 3 parts

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

B) The "With" argument to replace the whole description with the second part

$2
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top