# Support for wildcards in word censoring

**URL:** <https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866>\
**Category:** Feature\
**Created:** [March 27, 2015, 8:50am UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866 "2015-03-27T08:50:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonninseteli](https://avatars.discourse-cdn.com/v4/letter/t/eada6e/32.png) [@tonninseteli](https://meta.discourse.org/u/tonninseteli)\
**Post date:** [March 27, 2015, 8:50am UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866/1 "2015-03-27T08:50:44Z")

</div>

I don’t know if anyone actually uses this for other than fun but due to inflection it would be nice to be able to use wildcards when adding censored words.

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [November 9, 2016, 11:01pm UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866/7 "2016-11-09T23:01:48Z")

</div>

Hey look what we added this week:

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/5/3/c536196aac8b6aa7b0a877e4ef0f92634caa0e2b.png)

This is a new setting that works alongside `censored words`, but is a regular expression. The above example filters 7 digits of a phone number. If you like it, call me at 555-1234!

The value entered in the setting is checked to see if it matches too greedily like `(.)*`. Also, if cooking a post ever fails because the javascript engine timed out, then the `censored pattern` setting will be cleared on the assumption that it’s an evil regex like `(a|aa)+`.

---

<div class="post-metadata">

**Author:** ![boxels](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/boxels/32/65118_2.png) [@boxels](https://meta.discourse.org/u/boxels)\
**Post date:** [December 13, 2016, 11:52pm UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866/8 "2016-12-13T23:52:53Z")

</div>

Anyone have any guidance on newbies using regex patterns? Can you do more than one? does a list like this work, if so how do we enter it to make each word work?

> <https://pastebin.com/tcNWpHjg>

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [May 16, 2017, 7:23pm UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866/14 "2017-05-16T19:23:08Z")

</div>

Can there be more than one regex? It doesn’t seem to let you have multiples like `permalink normalizations`, for example.

I’ve a client who’d like phone numbers and emails hidden.

Edit: No, but you don’t need that, just use a `|`.

`\d{3}-\d{4}|[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+` will censor email addresses and xxx-yyyy phone numbers.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [July 9, 2018, 4:06pm UTC](https://meta.discourse.org/t/support-for-wildcards-in-word-censoring/26866/16 "2018-07-09T16:06:45Z")

</div>

This is now at /admin / logs /watched words /censor
