# No search result if filtered by unicode username

**URL:** <https://meta.discourse.org/t/no-search-result-if-filtered-by-unicode-username/243349>\
**Category:** Bug\
**Created:** [October 31, 2022, 5:16am UTC](https://meta.discourse.org/t/no-search-result-if-filtered-by-unicode-username/243349 "2022-10-31T05:16:22Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![topological](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@topological](https://meta.discourse.org/u/topological)\
**Post date:** [October 31, 2022, 5:16am UTC](https://meta.discourse.org/t/no-search-result-if-filtered-by-unicode-username/243349/1 "2022-10-31T05:16:23Z")

</div>

I met a bug that I cannot search a user’s posts by `@+username` in search box if the username contains unicode (e.g. Chinese `\p{Han}`).

The reason is regex used in following code (in `lib\search.rb`) only match ascii characters.

```ruby
advanced_filter(/^\@([a-zA-Z0-9_\-.]+)$/i) do |posts, match|

```

I tested if I add `allowed_unicode_username_characters` in the regex (i.e. adding a rule `advanced_filter(/^\@([a-zA-Z0-9_\-.\p{Han}]+)$/i)`), it works fine.

---

_[View the full topic](https://meta.discourse.org/t/no-search-result-if-filtered-by-unicode-username/243349)._
