How do I make a regex in yahoo pipes to eliminate everything from the beginning of a field to a particular word?
I am taking the rss from youtube,
http://www.youtube.com/rss/search/%s.rss
and would like to extract the view count and add that as a separate field. The view count is in the description field and appears as:
<div><span style="color:#666666;font-size:11px;">Views:</span>
431</div>
in this case the number I need to extract is 431.
Thanks,
Pietro
P.S: What follows is part of the description of a recent search. I did not put the whole code because it was too long.
<div style="font-size:12px;margin:3px 0px;"><span>a frankly shoddy cover of Susan Cadogan's big hit! Reminds me of my first 'squeeze' at The Hummingbird under 18's sesh, monkey boots, (couldn't afford Docs),fred perry t shirt and stapress 'champagne' 2 tone trousers robbed from Nelson House....................</span></div></td>
<td style="font-size:11px;line-height:1.4em;padding-left:20px;padding-top:1px;" width="146" valign="top"><div><span style="color:#666666;font-size:11px;">From:</span>
<a rel="nofollow" target="_blank" href="http://www.youtube.com/channel/UCZ0m4ZjZMNdOl4uyvrQm-yw">TheLastMehari</a></div>
<div><span style="color:#666666;font-size:11px;">Views:</span>
431</div>
<div style="white-space:nowrap;text-align:left;"><img style="border:0px none;margin:0px;padding:0px;vertical-align:middle;font-size:11px;" align="top" alt="" src="http://gdata.youtube.com/static/images/icn_star_empty_11x11.gif"> <img style="border:0px none;margin:0px;padding:0px;vertical-align:middle;font-size:11px;" align="top" alt="" src="http://gdata.youtube.com/static/images/icn_star_empty_11x11.gif"> <img style="border:0px none;margin:0px;padding:0px;vertical-align:middle;font-size:11px;" align="top" alt="" src="http://gdata.youtube.com/static/images/icn_star_empty_11x11.gif"> <img style="border:0px none;margin:0px;padding:0px;vertical-align:middle;font-size:11px;" align="top" alt="" src="http://gdata.youtube.com/static/images/icn_star_empty_11x11.gif"> <img style="border:0px none;margin:0px;padding:0px;vertical-align:middle;font-size:11px;" align="top" alt="" src="http://gdata.youtube.com/static/images/icn_star_empty_11x11.gif"></div>
The replace part should like this:
… and replacement part will be just
In other words, you’ll catch all the digits that are separated from
Views:string with non-digit symbols only – and throw off all the rest.UPDATE: You should enable
/smodifier for this to work. An alternative is using ‘universal’ character class instead of.:The replacement part should stay the same.