Two questions about regex in filters
Since my last question about regex in filter syntax was completely ignored, here are two more which I hope are easier to understand.
Is the syntax for regex
?body // foo
without slashes or
?body // /foo/
with the slashes that are required for regex as normal keywords?
Also, how does Hubzilla handle case-insensitive regex, if at all?
?body // /foo/i
with a slash at the beginning and a slash and a question mark at the end or
?body // (?i)foo
or
?body // /(?i)foo/
with a question mark and the letter i in parentheses at the very beginning of the regex?
Or not at all?
Or automatically anyway?
Or does it require the "manual" way, e.g.
?body // (F|f)oo
or
?body // /(F|f)oo/
?
My problem is that I'm testing regex-based allowlist filters on various connections. What they are supposed to do is only let posts through if they contain one or several certain keywords or hashtags, but all comments and all DMs (
|| ?item_private > 0 || ?item_thread_top == 0
). They don't work, though. In a few cases, they don't seem to filter anything, or they let completely unrelated posts through. In other cases, they don't let any posts through.
Now I'm trying to figure out what's going wrong. I've already checked the whole regex with
Regexr, and it does not have any technical errors in it.