The original name for “Notifier for Reddit” was “Grep Reddit”
It’s fitting that we have now released regular expressions support because the original name for Notifier for Reddit was actually Grep Reddit.
It was named after the legendary linux command line tool grep (general regular expression parser). The original idea was to provide the functionality that grep provides for a file but for reddit.
I eventually changed the name once I got feedback that most users would not know what grep is.
We have released an exciting and powerful new feature for Notifier for Reddit and that is support for RegEx or Regular Expression matches.
Regular Expressions are a concise language for defining pattern matching algorithms. Many of our more technically inclined users have requested this feature and we will hope it will allow them to more effectively match on some more advanced matching. So let’s get started with an example of a Regular Expression.
One really great tool for testing your Regular Expressions is regex101.com. When you go to regex101.com, you’re going to want to make sure that you select Python as the Flavor of Regular Expression language as that’s the Regular Expression engine that we’re using. Notice I have this text that I have already pasted in here and also notice that in this text, we have the word Reddit and then track occurring right here.
What I want to do is, say I want to be notified when the words Reddit and track occur within the same line, I can use Regular Expressions to do that matching. So I’m going to go to the Regular Expression input box and going to type in the word Reddit. As you can see it has found one match here.
Now I also want to match only if the word track occurs within the same line. So with Regular Expressions, one key character that you use to define a matching algorithm is the dot (.) character. That stands for any character essentially so that matches any possible character. And one great thing about this regex101 tool is that it shows you when you highlight over things exactly what that character means in a regular expression. Another key character is the plus (+) symbol which means match any number of times. So I’m going to edit that in and as you can see it’s going all the way to the end of the string because we’re saying, “Hey, find this word Reddit and then any number of characters after it.
Now we want to narrow it down further so I’m going to type in the word track and it’s going to match up to the word track.
What we can do now is used this exact same regular expression that we’ve created and we can input that into Notifier for Reddit to find matches that meet these criteria. So I am going to copy this Regular Expression, I’m going to go to Notifier for Reddit and I will add a Searcher.
- Match Type: For normal Notifier for Reddit String Match based search, I’m going to go regex.
- Regex: I’m going to paste Reddit.+track in.
- Posts/Comments: For posts and comments, I want both.
- Notification Interval: For the notification interval, I select instant.
- Include/Exclude Subreddit?: I don’t want to include or exclude Subreddit at this time.
I will hit Add and let’s go back to regex101.com and copy this string of text that we had. We are going to go to Reddit now, to the text Subreddit that we have set up before and we are going to make a new post.
Let’s go back to our email and what we are expecting now is for Notifier for Reddit to send us a match email pretty soon and there it is, Your Searcher for “Reddit.+track” found a new Post.
I’m going to scroll down and there is the match and we can instantly click on View on Reddit and respond if this was something we’re interested in and needed to respond on it.
So that should get you started with using Regular Expressions in Notifier for Reddit. Feel free to reach out to us if you have any questions and especially if you have any feature suggestions that will help you narrow down and get to what you are actually searching Reddit for.