42wim/matterbridge

Regex question

Closed this issue · 2 comments

Describe the bug
How can I fix this regex? It worked before but suddenly doesn't anymore.

To Reproduce
Use: replaceMessages=[ ["<(?!img|a)[^>]*>",""], ["&nbsp;"," "] ]

Expected behavior
HTML Tags should be filtered out of the message.

Screenshots/debug logs
level=error msg="regexp in msteams.test-teams failed: error parsing regexp: invalid or unsupported Perl syntax: (?!" prefix=gateway

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Matterbridge version: output of 1.26
42wim commented

This has never worked, golang doesn't support ?!
See https://github.com/google/re2/wiki/Syntax

Hi @42wim although I fully believe you I cannot explain then why it did seem to to work. See the following messages (one of many examples I can provide). The top one is sent before the regex, and the bottom one after:
image

Also I don't remember seeing the mentioned error message in the log.

Besides if it worked or not, is there any way I can edit this regex to make it work with Matterbridge?