Tiny Tiny RSS: Community

Regexp filter to match string

Hello

Not really a problem with tt-rss so didnt want to make this in support section.

Long ago i had a filter with proper regular expression matching for a given string,only i forgot to backup

so i need to make a new one, problem is i forgot how i made them =) Ive been doing alot of reading and i

understand that ^ denotes start and $ end so should be ^mystring$ but this didnt work,then i tried

\bmystring\b this seems to work but im unsure if its ok to use it like in wont hog all my resources or so

because the regexp is bad? Thanks for reading!

The reason the ^ and $ probably aren’t working is because the entirety of what you’re searching has to match.

This is mystring here.

Won’t match because the first character from the beginning (^) is T and the last ($) is .. Whereas the \b actually puts word boundaries around mystring.

 This is mystring and also "mystring" in quotes and at the end of the sentence mystring.

With word boundaries mystring would match three times in the second example.

 This is mystrings and won't match.

Because it is not the whole string, nor does it match word boundaries because of that trailing s.

Also regular expressions are often overused/abused so they get a bad reputation. There is utility in them though. TT-RSS using them to match random content from a third-party is a valid use and while there is overhead in using them, we’re talking milliseconds here. TT-RSS is supported on virtual and dedicated machines, which easily have enough resources to handle this type of thing.

Also keep in mind the filters run during the update, not when you’re using the web UI. Unless your server is under some sort of heavy load you’re not going to notice any problems.

Thank you so much for a highly informative answer it was very easy for me to understand with your

examples! Ill work something out,im using https://regex101.com to test my expressions and ive been

reading from https://www.regular-expressions.info :relaxed:

As I posted on another thread, keep in mind that TT-RSS uses slashes (/) as hardcoded delimiters and iu (case insensitive and ungreedy) flags for the internal filters.
So when testing your regular expressions non Regex101 set them accordingly.

I have 150+ feeds and roughly the same amount of more or less complex regex filters and the resource impact is trivial.

Thanks for link,i browsed around for quite a while but didnt find anything related to my search,i thought

it might be some modifiers or so enabled already,though ive accomplished my goal so im able to filter

now and doesnt hog my resources either :relaxed:

Just to clarify: TT-RSS uses a lowercase u flag which is for UTF-8 support (versus uppercase U which is ungreedy).

Of course. :man_facepalming: Thanks for the clarification.