Answers.Body: <p>In Twig, you never want to use delimiters inside other delimiters (e.g. <code>{{ ... {{ ... }} }}</code>).</p>
  
  <p>Here's how you would format it instead:</p>
  
  <pre><code>&lt;h3&gt;{{ wordBoldTitle | replace('#', '&lt;strong class="font-weight-extra-bold"&gt;' ~ entry.title ~ '&lt;/strong&gt;') | raw }}&lt;/h3&gt;
  </code></pre>
  
  <p>What we're doing here is using Twig <a href="https://twig.symfony.com/doc/3.x/templates.html#other-operators" rel="nofollow noreferrer">concatenation</a> (via the <code>~</code> operator) to combine our first string (<code>&lt;strong class="font-weight-extra-bold"&gt;</code>), whatever string <code>entry.title</code> results in, and then our second string (<code>&lt;/strong&gt;</code>).</p>
  
  <p>Alternatively we can use <a href="https://twig.symfony.com/doc/3.x/templates.html#string-interpolation" rel="nofollow noreferrer">string interpolation</a> to achieve this; however string interpolation requires double-quotes, so to do this we'll need to escape the double quotes already in our string:</p>
  
  <pre><code>&lt;h3&gt;{{ wordBoldTitle | replace("#", "&lt;strong class=\"font-weight-extra-bold\"&gt;${entry.title}&lt;/strong&gt;") | raw }}&lt;/h3&gt;
  </code></pre>
  
  <hr>
  
  <p>I also changed your replace filter from using a hash (e.g. <code>{'#':'xxx'}</code> to the simpler (at least in this case) comma-separated parameters. The hash works well if you need to replace multiple items, but the comma-separated parameters looks cleaner in my opinion when you only need to replace one item. You can find more about the replace filter formatting <a href="https://docs.craftcms.com/v3/dev/filters.html#replace" rel="nofollow noreferrer">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-20T16:12:40.173Z
Answers.Text: Works like a charm. Thank you
Answers.UserDisplayName: Jason
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-20T14:55:23.990Z
Answers.LastActivityDate: 2019-11-20T14:55:23.990Z
Answers.UserDisplayName: Jalen Davenport
Body: <p>Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this:</p>
  
  <pre><code>&lt;h3&gt;{{ wordBoldTitle|replace({'#':'&lt;strong class="font-weight-extra-bold"&gt;{{entry.title}}&lt;/strong&gt;'} )|raw }}&lt;/h3&gt;
  </code></pre>
  
  <p>Trying to concatenate the  with the entry.title. </p>
  
Tags: <craft3><entries><replace>
Title: Replace # with entry.title
ThreadText: # Replace # with entry.title
  
  (Asked by: username_0 on 2019-11-20)
  
  Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this:
  
  ```
  <h3>{{ wordBoldTitle|replace({'#':'<strong class="font-weight-extra-bold">{{entry.title}}</strong>'} )|raw }}</h3>
  
  ```
  
  Trying to concatenate the with the entry.title.
  
  **Tags:** craft3, entries, replace
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-20. Score: 2 | Accepted answer
  
  In Twig, you never want to use delimiters inside other delimiters (e.g. `{{ ... {{ ... }} }}`).
  
  Here's how you would format it instead:
  
  ```
  <h3>{{ wordBoldTitle | replace('#', '<strong class="font-weight-extra-bold">' ~ entry.title ~ '</strong>') | raw }}</h3>
  
  ```
  
  What we're doing here is using Twig [concatenation](https://twig.symfony.com/doc/3.x/templates.html#other-operators) (via the `~` operator) to combine our first string (`<strong class="font-weight-extra-bold">`), whatever string `entry.title` results in, and then our second string (`</strong>`).
  
  Alternatively we can use [string interpolation](https://twig.symfony.com/doc/3.x/templates.html#string-interpolation) to achieve this; however string interpolation requires double-quotes, so to do this we'll need to escape the double quotes already in our string:
  
  ```
  <h3>{{ wordBoldTitle | replace("#", "<strong class=\"font-weight-extra-bold\">${entry.title}</strong>") | raw }}</h3>
  
  ```
  
  ---
  
  I also changed your replace filter from using a hash (e.g. `{'#':'xxx'}` to the simpler (at least in this case) comma-separated parameters. The hash works well if you need to replace multiple items, but the comma-separated parameters looks cleaner in my opinion when you only need to replace one item. You can find more about the replace filter formatting [here](https://docs.craftcms.com/v3/dev/filters.html#replace).
  
  > **Comments:**
  > **username_0**: Works like a charm. Thank you  
  
  ---
  
  