Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve filter support #1423

Merged
merged 6 commits into from
Mar 28, 2023
Merged

Improve filter support #1423

merged 6 commits into from
Mar 28, 2023

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Mar 28, 2023

The filter expression can take one of the following forms:

  1. An atomic filter: a Perl-compatible regular expression, as accepted by PHP, between forward slashes (/). For example, /reg(ular expression|ex)/ will keep only items whose title or content matches the regular expression between the slashes (i.e. contain the phrase “regular expression” or “regex”). Learn more about regular expressions on https://www.regular-expressions.info/.
  2. A field-specific filter: an atomic filter preceded by one of the field names below and a colon:
    • title:/regex/ will keep only items whose title matches the regular expression between the slashes.
    • content:/regex/ will keep only items whose content matches the regular expression between the slashes.
    • author:/regex/ will keep only items which have an author that matches the regular expression between the slashes.
    • category:/regex/ will keep only items which have a category that matches the regular expression between the slashes.
  3. A negated filter is either an atomic filter or a field-specific filter preceded by an exclamation mark (!). It will only keep items would not be kept by the filter after the exclamation mark.

@netlify
Copy link

netlify bot commented Mar 28, 2023

Deploy Preview for selfoss ready!

Name Link
🔨 Latest commit 12a32cc
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/642368620e3d1e0008055d42
😎 Deploy Preview https://deploy-preview-1423--selfoss.netlify.app/docs/usage/filters
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

In preparation for filter language with more features.
This will allow creating negative filters using negative lookaheads for just body.

Fixes: #1422
This will allow expressing a filter that forbids a string in both title and content.

Fixes: #1422
This should catch regex errors sooner than waiting for source update.
@GutHib
Copy link

GutHib commented Mar 28, 2023

Wow, that is truely amazing. Does the project accept donations or should that go towards a charity?

@jtojnar
Copy link
Member Author

jtojnar commented Mar 28, 2023

I can send you an IBAN number if you want to do a bank account transfer. But donating to Internet Archive or Wikimedia Foundation is also fine.

@GutHib
Copy link

GutHib commented Mar 29, 2023

Mail sent to your gmail address, you can find it in your spam folder.

@jtojnar jtojnar mentioned this pull request Mar 29, 2023
@jtojnar
Copy link
Member Author

jtojnar commented Apr 10, 2023

@GutHib Thank you for your donation ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants