The Regex Module is by far the most completed module in Yahoo Pipes. Regex is short for “regular expressions”. Regular expressions allow you to do advanced “search and replace” on various forms of data.
Entire books have been written about regular expressions so they go way beyond the scope of this guide, so I will just briefly go over the Regex Module and give you some resources to study up on them some more.
Using regular expressions is like using a “souped up” version of Find and Replace. It’s a precise and flexible way to match strings of text, such as individual characters or words.
The most basic regular expression consists of a single literal character, e.g.: “o”. It will match the first occurrence of that character in the string. If the string is “Hotels in Vancouver”, it will match the “o” after the “H” in “Hotels”. Regex can match all sorts of text strings to help you find and replace data.
The “g i m s” switches stand for:
- g – Allow global matching (all occurrences of a pattern in a string)
- i – Allow case-insensitive matching
- m – Allow ^ and $ to match anywhere in a string and not just at the very beginning or very end
- s – Allow dot to match a newline
As you can see, the Regex Module is quite advanced, but don’t worry, you don’t need to understand it to use Yahoo Pipes. There is still lots you can accomplish without the Regex Module.
In this example, we’re going to use an extremely basic regular expression to add “Free Stuff!” to the beginning of every Craigslist posting title using the Regex Module.
Here’s the RSS Feed URL we’ll be working with:
http://vancouver.en.craigslist.ca/zip/index.rss
First, lets plug the URL into the Fetch Feed Module and see what it looks like in the Debugger pane:
Now lets plug it into the Regex Module and use some regular expressions. Because we want to work on the title, we need to select “item.title” from the dropdown list, and replace [(^)] with [Free Stuff! $1] (omitting all outer [ ]’s).The $1 matches the entire title, and (^) matches the beginning of the expression.
Now lets see what our finished result looks like in the Debugger pane:
That example didn’t even scratch the surface of the most powerful module in Yahoo Pipes, but if you are interested in unleashing the power of regular expressions, I highly recommend checking out some additional resources like:




Recent Comments