Regex "is not a constant" error in Golang : <p>I'm trying to write a regex in Golang to verify that a string only has alphanumerics, periods, and underscores. However, I'm running into an error that I haven't seen before and have been unsuccessful at Googling.</p>

<p>Here's the regex:</p>

<pre><code>pattern = regexp.MustCompile(`^[A-Za-z0-9_\.]+`)
</code></pre>

<p>Here is the error:</p>

<pre><code>const initializer regexp.MustCompile("^[A-Za-z0-9_\\.]+") is not a constant
</code></pre>

<p>What does "not a constant" mean and how do I fix this?<br>
Thanks.</p>
