# A closing round bracket breaks word censoring

**URL:** <https://meta.discourse.org/t/a-closing-round-bracket-breaks-word-censoring/61782>\
**Category:** Bug\
**Created:** [2017 年 4 月 28 日午後 3:09 UTC](https://meta.discourse.org/t/a-closing-round-bracket-breaks-word-censoring/61782 "2017-04-28T15:09:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![rizka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rizka/32/79717_2.png) [@rizka](https://meta.discourse.org/u/rizka)\
**Post date:** [2017 年 4 月 28 日午後 3:09 UTC](https://meta.discourse.org/t/a-closing-round-bracket-breaks-word-censoring/61782/1 "2017-04-28T15:09:08Z")

</div>

I have recently been working on word censoring patterns to block some Finnish language expressions.

> [@How to use Discourse regexes with watched words?](https://meta.discourse.org/t/could-someone-tell-me-about-discourse-regexes/61522):
>
> I’ve worked on censoring the most vulgar swear words with regular expressions today. Why regexes? Well, in Finnish and other Uralic languages like Hungarian and Estonian words are inflected. A single swear word could have maybe thousands of mutations, which is why it is awesome to have the ability to use regex patterns. It is also no coincidence that it was another Finn who proposed this originally. I need some quick advice about which regex flavor Discourse uses. I experience some unexpected…

In the process, we discovered something I consider as a bug. I can reproduce it with censored words and censored patterns. Steps:

1. Go to /admin/site\_settings/category/posting.
2. Scroll down and locate censored words and censored patterns.
3. Censor something if you already haven’t.
4. Open editor and write something nasty. You will see it censored like this: ■■■■■.
5. Type a closing bracket ). Every censored word which precedes the bracket will show!

The closing bracket appears for instance in the common smiley `:)` which is converted to the respective emoji of course. So if you end your post with `:)`, you can actually type anything you want without any censorship!

If it is not a real bug, feel free to merge these topics. 🙂

---

_[View the full topic](https://meta.discourse.org/t/a-closing-round-bracket-breaks-word-censoring/61782)._
