Regex (Regular Expressions) filters are a powerful way to customize your feeds by including or excluding content based on specific patterns. Here’s a step-by-step guide to help you effectively use regex filters in RSS.app based on common use cases:
1. Understanding Regex Filters
Regex filters allow you to:
Include specific posts: Show only posts that match certain patterns.
Exclude specific posts: Hide posts that match certain patterns.
Modify feed content dynamically: Match patterns in titles, descriptions, or other fields.
Regex Operators and Syntax Table
Operator/Syntax | Description | Example | Explanation |
| Matches any single character except a newline. |
| Matches |
| Matches 0 or more repetitions of the preceding element. |
| Matches |
| Matches 1 or more repetitions of the preceding element. |
| Matches |
| Matches 0 or 1 repetition of the preceding element. |
| Matches |
` | ` | OR operator (matches either pattern). | `cat |
| Matches the start of a string. |
| Matches |
| Matches the end of a string. |
| Matches |
| Matches any one character in the brackets. |
| Matches |
| Matches any one character not in the brackets. |
| Matches any character except |
| Groups expressions. Used for capturing. |
| Matches |
| Matches exactly |
| Matches |
| Matches |
| Matches |
| Matches between |
| Matches |
| Escapes a special character. |
| Matches the literal |
| Matches any digit (0–9). |
| Matches |
| Matches any non-digit. |
| Matches |
| Matches any word character (letters, digits, underscore). |
| Matches |
| Matches any non-word character. |
| Matches |
| Matches any whitespace character. |
| Matches spaces, tabs, or newlines. |
| Matches any non-whitespace character. |
| Matches words or symbols, but not spaces. |
2. Common Use Cases
Remove Unwanted Characters or Text
If you want to remove specific parts of a title or description, use a regex pattern.
Example:
Pattern:
^(.*?)\s—.*
Result: Matches the first part of a title before the
—
symbol and removes everything after it.Use Case: Clean titles like
Breaking News — World Updates
to only showBreaking News
.
Whitelist Specific Keywords
Include posts that contain specific words or phrases.
Example:
Pattern:
.*(AI|Machine Learning|Data Science).*
Result: Matches posts containing
AI
,Machine Learning
, orData Science
.Use Case: Curate a feed with only tech-related content.
Blacklist Specific Keywords
Exclude posts with unwanted words or phrases.
Example:
Pattern:
.*(Sports|Celebrity|Gossip).*
Result: Hides posts containing
Sports
,Celebrity
, orGossip
.Use Case: Avoid non-business-related content.
Filter by URL or Domain
Use regex to include or exclude posts from specific domains.
Example:
Pattern:
.*example\.com.*
Result: Filters posts that mention
example.com
in the URL.Use Case: Target posts from a specific website.
Match Specific Date Formats
Include or exclude posts based on date formats.
Example:
Pattern:
\d{4}-\d{2}-\d{2}
Result: Matches a date format like
2024-12-31
.Use Case: Focus on posts with structured date formats.
3. How to Apply Regex Filters
Navigate to the feed/bundle filters you want to apply the filter to.
Go to Replace or Remove and Add Replace/Remove rule
Enable Regular expression by clicking on .*
Add Regex Pattern:
.*example\.com.*
4. Tips
Use tools like Regex101 to validate your regex patterns before applying them.
Begin with basic patterns and refine as you understand how they affect your feed.
If you're having trouble creating a regex pattern, you can use AI tools like ChatGPT to assist you. Simply describe what you're trying to filter or match, and it can generate the necessary regex filter for you. For example, you can ask:
"Create a regex pattern to match titles containing the words 'AI' or 'Machine Learning'."
"Generate a regex to exclude URLs containing 'example.com'."
5. Troubleshooting
Double-check your regex syntax and ensure it matches the target content.
Ensure no conflicting filters are applied.
6. Example Scenarios
Replace specific hashtags with a keyword
Use case: Replace "#AI" and "#MachineLearning" with "Technology".
Filter type: Replace
Regex:
#(AI|MachineLearning)
Replace emoji with text
Use case: Replace all emojis with the text
[EMOJI]
.Filter type: Replace
Regex:
[^\w\s,.!?]
Replace certain text patterns
Use case: Replace "Breaking News:" with "[Updated]".
Filter type: Replace
Regex:
^Breaking News:
Replace company name in titles
Use case: Replace "RSS.app" with "Our Service".
Filter type: Replace
Regex:
RSS\.app
Remove text after a specific delimiter
Use case: Remove everything after a "—" in a title.
Filter type: Remove
Regex:
—.*
Remove URLs from content
Use case: Remove all URLs from feed descriptions.
Filter type: Remove
Regex:
https?://[^\s]+
Remove special characters
Use case: Remove all non-alphanumeric characters except spaces.
Filter type: Remove
Regex:
[^a-zA-Z0-9\s]
Remove titles starting with specific keywords
Use case: Remove all posts with titles starting with "Promo" or "Ad".
Filter type: Remove
Regex:
^(Promo|Ad).*
Remove trailing hashtags
Use case: Remove hashtags at the end of a title.
Filter type: Remove
Regex:
\s#[\w]+$
Remove numbers from text
Use case: Remove all digits from descriptions.
Filter type: Remove
Regex:
\d+