Simon 2.6 sneak peek update: Find filter

As mentioned in previous blog posts, I'm working on version 2.6 of Simon, my flagship Mac app to monitor websites and servers for changes and failures.

A few brave/lucky people have tried the previous alpha release, and didn't find any problems with it, which is always reassuring. Now I have another alpha available. It is only available to licensed users currently; it'll be opened up to everyone once in beta. If you want to try it, and help me test these new features, please contact me for the download URL.

I spent the past week working on a new filter plugin. It turned out to be one of the most powerful (and code-intensive) features of Simon, second only to the Script plugin.

I was originally planning on having separate "Keyword" and "Regular Expression" plugins, but decided that it'd make more sense to combine them into one, since they have a lot of commonality. So the new plugin is called simply "Find", and it supports both.

Here are the release notes on this new feature:

  • Added a Find filter plug-in. This is as easy or powerful as you want: it supports both simple text matching and regular expression searches.
  • The Find filter plug-in can find one occurrence, find a specific occurrence (like for the Block plug-in), find all occurrences (outputting them separated by your choice of delimiter), or find & replace those possiblities, outputting something else for the match(es) -- especially useful with regular expression searches.
  • For simple text matching mode, the Find plug-in supports finding Contains, Starts With, Whole Words, and Ends With. For regular expression mode, it has a helpful menu of regular expression operators to help build expressions, including a dynamically-updating list of capture group markers for replacements.
  • Find-based filters can even result in a failure if the text was or wasn't found, if desired -- useful to detect text that mustn't or must be there.

Here's a screenshot of the filter portion of the Edit Test window, demonstrating some of the power of regular expression-based filtering, to output the RSS feed URL of a web page. Notice that it outputs just the contents of the first capture group (the portion between parentheses), rather than entire match:

And a simple text match in the Edit Filter window:

The little drop-down menu with the magnifying glass icon hides a lot of power; use it to choose the find or find & replace mode, text matching or regular expressions, and other options. In regex mode it lists lots of regex operators as a handy guide; just choose one to insert it into the find or replace field (as appropriate):

Lastly, as another example, here's the filter portion of the Edit Filter window showing one of the built-in regular expression-based filters, that uses Find All to list all URLs in the input as a comma-separated list (and result in a failure if there aren't any):

Want to try it yourself? Just ask!