fritter icon indicating copy to clipboard operation
fritter copied to clipboard

Add basic regex filter

Open Huhni opened this issue 3 years ago • 0 comments

I added a filtering option as requested by #86, #148, #287 At the moment it doesn't hide the tweets completely, but instead shows a small card containing This tweet was filtered. That is because I don't have any experience with Dart/Flutter or Android development in general. I just wanted to provide a minimal working example that can be improved by people who actually know what they're doing.

It works by adding the words you want to get filtered separated by | to the new Filters setting. It just converts the string into a regular expression so you can use expressions like \W[a-z]{2,3} and so on.

Example: bitcoin|nft|#sponsored|trump

The filter is case insensitive and removes all tweets containing the regex, so if you don't want tweets with trumpet removed you need to use trump\b instead of trump. Since the string gets evaluated as regex you need to escape characters like dots or brackets if you want to use them in the filter.

Huhni avatar Mar 17 '22 14:03 Huhni