Skip to content
Translate Ideas and Comments
Choose language:
There was an error during translation

Settings and activity

1 result found

  1. 172 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    An error occurred while saving the comment
    JCRouzer commented  · 

    The AutoMod/Blocked Terms filter currently only interprets messages for exactly matching the text somewhere within the message. With the only dynamic function is an asterisk (*) character acting as a wildcard to replace any number of simple characters at that point in the sequence. This does not include spaces or international similar characters however so all a user or bot needs to do is space a word out and it will require an entire new rule if not multiple.

    For example a bot site with 3 words to it's name is being posted by bots often. These sites also use words which can be relevant on stream so the individual words would never be blocked. Currently to account for the various characters and spacings I would need to write as many rules for this one bot site as I have overall currently. These can be as simple as "Cool" vs "C O O L".

    In order to deal with these en mass it would be best to allow for use of Regex rules. The rules always begin with forward slash (/) and end with flags after the final forward slash (/) making them easy to identify.

    To explain how this helps, if the blocked term has an L then the user could replace that with an uppercase I. The term would have to be either 2 rules or an * however the latter could affect other words unintentionally. With regex you could place (i|l) to catch either of only those 2 characters. Similar rules can be used to account for a Unicode character for another language which appears the same as one in the which are not currently caught by blocked terms. For instance (e|е) would account for one case I have dealt with previously.

    To return to my example bot site, I could have a single rule which is specific enough to catch posts about this site and wide enough to catch any variation of it all while not interrupting any use of the words in it's name. While these rules can become long due to repeatedly checking for white space or spelled out symbols that is still preferable over many near identical rules.

    As Regex is a tool which has been widely used for some time there is a lot of existing documentation and online resources for users to reference and test their rules.

    Worth noting that Regex has a flag for case insensitivity, however the Blocked Terms already have this so the need for it's use depends on existing implementation.

    The expression /Site[\s]*For([\s.(dot)])*pros/gi catches all of the following cases which would each need their own Blocked Term rule.

    SiteFor Pros
    SiteFor .Pros
    SiteFor. Pros
    SiteFor . Pros
    SiteFor (dot)Pros
    SiteFor(dot) Pros
    SiteFor (dot) Pros
    Site ForPros
    Site For Pros
    Site For.Pros
    Site For .Pros
    Site For. Pros
    Site For . Pros
    Site For(dot)Pros
    Site For (dot)Pros
    Site For(dot) Pros
    Site For (dot) Pros

    JCRouzer supported this idea  ·