# Formula replaceRE HTML tag in HUGO

**URL:** <https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608>\
**Category:** support\
**Created:** [February 22, 2020, 2:35pm UTC](https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608 "2020-02-22T14:35:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TIGA\_DUA](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tiga_dua/32/4073_2.png) [@TIGA\_DUA](https://discourse.gohugo.io/u/TIGA_DUA)\
**Post date:** [February 22, 2020, 2:35pm UTC](https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608/1 "2020-02-22T14:35:14Z")

</div>

How to use the Replace GOHUGO replaceRE Function for HTML A tags.

Some Example

```
{{ $content := replace .Content "Jhon Doe" "Sutaryono" }}

{{ $content = replaceRE $content "<a href=\"http://example:1313/dynamic-link">Some Text</a>" "<span>Some Text</span>" }}

{{ $content | safeHTML }}

```

🙈

🙉

Anybody want to share the REGEX formula for this case

Thanks 😆 😆 😁

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [February 23, 2020, 6:50am UTC](https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608/2 "2020-02-23T06:50:32Z")

</div>

Hi there,

Regex in general is not specific to Hugo, and as such is outside the scope of this forum. This [page](https://gohugo.io/functions/replacere/) in the docs has some links about regex you might find useful.

---

<div class="post-metadata">

**Author:** ![TIGA\_DUA](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tiga_dua/32/4073_2.png) [@TIGA\_DUA](https://discourse.gohugo.io/u/TIGA_DUA)\
**Post date:** [January 23, 2023, 7:31am UTC](https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608/3 "2023-01-23T07:31:22Z")

</div>

Ok. I have used python for that. For certain REGEX that cannot be handled with hugo. 🍻

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 23, 2023, 7:40am UTC](https://discourse.gohugo.io/t/formula-replacere-html-tag-in-hugo/23608/4 "2023-01-23T07:40:16Z")

</div>


