# replaceRE gives syntax error

**URL:** <https://discourse.gohugo.io/t/replacere-gives-syntax-error/22624>\
**Category:** support\
**Created:** [January 3, 2020, 12:59pm UTC](https://discourse.gohugo.io/t/replacere-gives-syntax-error/22624 "2020-01-03T12:59:05Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![moorereason](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/moorereason/32/592_2.png) [@moorereason](https://discourse.gohugo.io/u/moorereason)\
**Post date:** [January 4, 2020, 1:05am UTC](https://discourse.gohugo.io/t/replacere-gives-syntax-error/22624/5 "2020-01-04T01:05:12Z")

</div>

There are two layers of interpretation here. One is Go template strings and the other is regular expressions.

For Go strings, the Go spec is helpful. See [https://golang.org/ref/spec#String\_literals](https://golang.org/ref/spec#String_literals). Literal strings use the back tick. Interpreted strings use the double quote.

Escaping the parenthesis is needed for the regexp pattern itself and has little to do with Go.

As @alexandros said, I almost always use literal strings when building regexp patterns in Go or Hugo.

---

_[View the full topic](https://discourse.gohugo.io/t/replacere-gives-syntax-error/22624)._
