0

From a RSS content I'd like to remove everything except specified href links

Example:

<div class='text'>
<div class="center"> <b><a rel="nofollow" target="_blank" href="http://domain1.com/html/12345948/howto.pdf"></a></b> </div>
</div>
<br>
<div class='text'>
<div class="center"> <b><a rel="nofollow" target="_blank" href="http://www.domain2.com/php/8mgfjghf/file.html">file</a></b>

<b><a rel="nofollow" target="_blank" href="http://www.domain1.com/78/78.html">78</a></b>

<b><a rel="nofollow" target="_blank" href="https://www.domain3.com/5k9f"></a></b> </div>
</div>

I wish my final output like below:

http://domain1.com/html/12345948/howto.pdf
http://www.domain2.com/php/8mgfjghf/file.html
http://www.domain1.com/78/78.html
https://www.domain3.com/5k9f

Also, domain names are fixed, meaning if domain4.net is present I do not want it in the output.

  • seems i have to state that I want to use the yahoo pipes regex module for the above task. – skexris May 12 '15 at 6:06
0

Do you only need to use regex? This works for the provided example:

cat file | grep href | sed 's/.*href=\"//g' | cut -d\" -f1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.