# Replace word not including wildcard

**URL:** https://meta.discourse.org/t/replace-word-not-including-wildcard/190379
**Category:** Bug
**Created:** [May 14, 2021, 6:36am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379 "2021-05-14T06:36:25Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![emilio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/emilio/32/132550_2.png) [@emilio](https://meta.discourse.org/u/emilio)
#### Post date: [May 14, 2021, 6:36am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/1 "2021-05-14T06:36:25Z")

</div>

Trying out the new replace word/phrase functionality but am unclear how the wildcard works in the case below.

I wanted to replace `server log` with a url to info on how to get logs. It nicely leaves the word and creates a link. So I tried to use `server log*` to also cover `server logs` but the link created does not include the wildcard. Not a huge deal just a bit weird looking. is there a way to make it include the S. Image of what I mean

![word_replace](https://global.discourse-cdn.com/meta/original/3X/b/1/b1924f3e106127a503d0791d7a7c7ac2b82e884b.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 18, 2021, 2:43am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/2 "2021-05-18T02:43:37Z")

</div>

> [@emilio](#):
>
> but the link created does not include the wildcard.

Oh this sounds like a bug to me. The \* should capture and be included in the link. We will get it sorted.

---

<div class="post-metadata">

### Author: ![nbianca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nbianca/32/157984_2.png) [@nbianca](https://meta.discourse.org/u/nbianca)
#### Post date: [May 18, 2021, 7:49am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/4 "2021-05-18T07:49:59Z")

</div>

The wildcard character makes the use of regular expression necessary when matching, no matter what the value of watched\_words\_regular\_expression is. This is because \* is converted to \S\*. I fixed the problem in:

[https://github.com/discourse/discourse/pull/13084](https://github.com/discourse/discourse/pull/13084)

---

<div class="post-metadata">

### Author: ![emilio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/emilio/32/132550_2.png) [@emilio](https://meta.discourse.org/u/emilio)
#### Post date: [May 27, 2021, 12:58am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/5 "2021-05-27T00:58:53Z")

</div>

Not sure if this was pushed to production but I edited ours to include the \* again and now all of ours that have the wildcard will not create the link but the ones without the wildcard it will

 ![replaceword](https://global.discourse-cdn.com/meta/original/3X/d/1/d197014ef8473f46aa71c8d6670ebfc7c941706f.png)

 ![Test_word_replace](https://global.discourse-cdn.com/meta/original/3X/d/4/d41b0ca494650398cedd2e1001192e21da30b100.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 27, 2021, 11:38pm UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/6 "2021-05-27T23:38:39Z")

</div>

I think you are behind on deploys, I just kicked off a deploy, can you try again in 5 minutes?

---

<div class="post-metadata">

### Author: ![emilio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/emilio/32/132550_2.png) [@emilio](https://meta.discourse.org/u/emilio)
#### Post date: [May 27, 2021, 11:48pm UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/7 "2021-05-27T23:48:12Z")

</div>

Awesome. Working now 🙂 Y’all rock. Thanks @sam and @nbianca

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 29, 2021, 8:00am UTC](https://meta.discourse.org/t/replace-word-not-including-wildcard/190379/8 "2021-05-29T08:00:36Z")

</div>

This topic was automatically closed after 32 hours. New replies are no longer allowed.
