Skip to main content

How to use Regular Expression (Regex) to filter RSS feeds

Learn what Regex filters are and how to use them in RSS.app

Updated over 2 weeks ago

Regex (Regular Expressions) filters are a way to customize your feeds by including or excluding content based on specific patterns.

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.

a.b

Matches aab, acb, but not ab or a\nb.

*

Matches 0 or more repetitions of the preceding element.

ab*

Matches a, ab, abb, abbb.

+

Matches 1 or more repetitions of the preceding element.

ab+

Matches ab, abb, abbb, but not a.

?

Matches 0 or 1 repetition of the preceding element.

colou?r

Matches color or colour.

`

`

OR operator (matches either pattern).

`cat

^

Matches the start of a string.

^Hello

Matches Hello only at the beginning of the string.

$

Matches the end of a string.

world$

Matches world only at the end of the string.

[]

Matches any one character in the brackets.

[abc]

Matches a, b, or c.

[^]

Matches any one character not in the brackets.

[^abc]

Matches any character except a, b, or c.

()

Groups expressions. Used for capturing.

(ab)+

Matches ab, abab, ababab. Captures each repetition.

{n}

Matches exactly n repetitions.

a{3}

Matches aaa.

{n,}

Matches n or more repetitions.

a{2,}

Matches aa, aaa, aaaa, etc.

{n,m}

Matches between n and m repetitions.

a{2,4}

Matches aa, aaa, or aaaa.

\

Escapes a special character.

\.

Matches the literal . character.

\d

Matches any digit (0–9).

\d+

Matches 123, 456, etc.

\D

Matches any non-digit.

\D+

Matches abc, @#$, etc.

\w

Matches any word character (letters, digits, underscore).

\w+

Matches hello, word_1, etc.

\W

Matches any non-word character.

\W+

Matches @#$, (space), etc.

\s

Matches any whitespace character.

\s+

Matches spaces, tabs, or newlines.

\S

Matches any non-whitespace character.

\S+

Matches words or symbols, but not spaces.


How to Apply Regex Filters

1. Navigate to the Filters tab in Feed Overview.

2. Scroll down until you see Advanced rules to modify posts and click + Add Rule.

3. Click the dropdown and choose your desired rule type:

4. Type the text or pattern you want to filter out in the input field.

5. Toggle the Enable Regex switch to activate Regex mode.

6. Choose whether you want to apply the filter to the Title, Description, Link, or Image URL.

That’s it! Posts that match your Regex rules will now be filtered out from your feed.


Example Scenarios

1) Replace text in title or description

Goal: Normalize hashtag formats by replacing all hashtags like #AI2025 with just technology.

  • Rule type: Replace text in title or description

  • Source text: #([A-Za-z0-9]+)

  • New text: technology

  • Enable Regex: On

2) Remove text in title or description

Goal: Remove all non-alphanumeric characters except spaces.

  • Rule type: Remove text in title or description

  • Source text: [^a-zA-Z0-9\s]

3) Replace URL substring

Goal: Redirect users from https://www.example.com to https://www.newsite.com but keep the rest of the URL intact.

  • Rule type: Replace URL substring

  • Text to replace: https://www.example.com

  • Replacement text: https://www.newsite.com

  • Enable Regex: On

4) Hide posts matching specific text

Goal: Hide posts that contain pictures.

  • Rule type: Replace URL substring

  • Source text: ^(?!.*\.jpg).+$

  • Enable Regex: On


💡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.

Did this answer your question?