# Hope Watched words 增加了对非英文字符的支持

**URL:** https://meta.discourse.org/t/hope-watched-words-adds-support-for-non-english-characters/396109
**Category:** Bug
**Created:** [2026 年2 月 14 日 15:31 UTC](https://meta.discourse.org/t/hope-watched-words-adds-support-for-non-english-characters/396109 "2026-02-14T15:31:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### 作者： ![Noble\_Fish](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@Noble\_Fish](https://meta.discourse.org/u/Noble_Fish)
#### 发布日期： [2026 年2 月 14 日 15:31 UTC](https://meta.discourse.org/t/hope-watched-words-adds-support-for-non-english-characters/396109/1 "2026-02-14T15:31:36Z")

</div>

这是一个有用的审核工具，但它对非英文字符的支持很差，而且非英文字符的存在甚至会影响英语和数字的检测。这里，以简体中文词语“测试”为例，被监控词列表包含三个元素：“测试”、“Test”和“123”。在下面的测试中，这三个示例都没有触发被监控词。

 ![No matches found](https://global.discourse-cdn.com/meta/original/4X/7/7/9/7792aca9b49feca09f3b904c4d24f5290ad740ce.png)

我在网站内搜索，发现了另一个关于“审查词”（Censored words）的类似问题：[https://meta.discourse.org/t/censored-words-do-not-respect-word-boundaries-in-non-latin-alphabet/102916。这似乎是整个监控词匹配系统普遍存在的问题？](https://meta.discourse.org/t/censored-words-do-not-respect-word-boundaries-in-non-latin-alphabet/102916%E3%80%82%E8%BF%99%E4%BC%BC%E4%B9%8E%E6%98%AF%E6%95%B4%E4%B8%AA%E7%9B%91%E6%8E%A7%E8%AF%8D%E5%8C%B9%E9%85%8D%E7%B3%BB%E7%BB%9F%E6%99%AE%E9%81%8D%E5%AD%98%E5%9C%A8%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%9F)

---

<div class="post-metadata">

### 作者： ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### 发布日期： [2026 年2 月 16 日 14:45 UTC](https://meta.discourse.org/t/hope-watched-words-adds-support-for-non-english-characters/396109/2 "2026-02-16T14:45:47Z")

</div>

感谢您的报告，此问题将通过以下链接修复：

> <https://github.com/discourse/discourse/pull/37844>
>
> Watched words failed to match in CJK (Chinese, Japanese, Korean) and other space…less scripts because word boundary detection relied on whitespace or non-word characters. Languages like Chinese don't use spaces between words, so "测试" inside "这是一个测试文本" was never matched.
> 
> Introduce a SPACELESS\_SCRIPTS constant covering Han, Hiragana, Katakana, Hangul, Thai, Lao, Myanmar, Khmer, and Tibetan Unicode ranges. Update \`match\_word\_regexp\` for both Ruby and JS engines so that characters from these scripts are treated as word boundaries. This allows a CJK watched word to match when surrounded by other CJK characters, and a Latin watched word to match when adjacent to CJK text (e.g., "Test" in "我的Test很好"), while still preventing partial Latin matches (e.g., "Testing" does not match "Test").
> 
> Also fix the admin watched word testing modal to use \`RegExp.exec()\` with capture group extraction instead of \`String.match()\`, since the new boundary patterns include a leading consuming group.
> 
> Remove the outdated "non-chrome browsers do not support lookbehind" comment — all major browsers have supported lookbehind since 2023.
> 
> https://meta.discourse.org/t/71288
> https://meta.discourse.org/t/396109

---

<div class="post-metadata">

### 作者： ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### 发布日期： [2026 年2 月 20 日 23:56 UTC](https://meta.discourse.org/t/hope-watched-words-adds-support-for-non-english-characters/396109/4 "2026-02-20T23:56:22Z")

</div>


