# Censored pattern

**URL:** https://meta.discourse.org/t/censored-pattern/66912
**Category:** Bug
**Created:** [July 27, 2017, 9:40am UTC](https://meta.discourse.org/t/censored-pattern/66912 "2017-07-27T09:40:35Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)
#### Post date: [August 15, 2017, 12:25pm UTC](https://meta.discourse.org/t/censored-pattern/66912/6 "2017-08-15T12:25:01Z")

</div>

@sam is correct in that `\b` doesn’t seem to match _any_ Unicode, or any non-ASCII word breaks.

`\w` seems to be defined narrowly as `[A-Za-z0-9_]`, probably just to parse source-code type texts. And `\b` is simply `(\w\W|\W\w)`. So using `\b` has the net effect of turning any character outside simple ASCII letters/digits into _white-space_ letters. There doesn’t seem to be an easy way out to deal with this.

An option to deal with this is to **omit the `\b` wrapping altogether** – a good idea because this will not work on any language _outside_ English, which is quite restrictive if you ask. Not the entire world speaks English…

Put a warning on the regexp filter setting that uses must manually wrap their regexp’s in `\b` if they are dealing with strict English.

This has multiple benefits:

1. For English – anyone who is capable of entering a regexp string should know how to put in a pair of `\b`’s

2. For W. European languages – i.e. the extended Latin set, they can put `\b` around all the words that contain ASCII endings, and do more precise filtering on words with non-ASCII endings/beginnings.

3. For CJK languages – do nothing, simply search character-for-character. CJK languages are mostly not written with strict white-spacing between words, so there is no point to artificially search for a _word_ based on white-space surrounding the words because those white-spaces won’t be there. White-space is not used to delimiter words. In fact, for Chinese, Japanese and Chinese characters in Korean, words are _not_ separated from one another; they stick together to form a single stream and there is nothing to break them apart other than context.

4. For other languages – e.g. Arabic etc. you are no worse off than without the `\b` wrapping. In fact, with the `\b` wrapping, the user can do _nothing_. Without them, the user can still do some filtering.

---

_[View the full topic](https://meta.discourse.org/t/censored-pattern/66912)._
