In Go, the backslash (\
) is the escape character of an interpreted string literal (using "..." as enclosures). In your case, you´d rather want to use a raw string literal (using `...` as enclosures).
Let's look at this piece of code:
package main
import "fmt"
func main() {
fmt.Println("^\\[^\\]*\\$")
fmt.Println(`^\\[^\\]*\\$`)
}
Result:
^\[^\]*\$
^\\[^\\]*\\$
You can see that it is the second option that is the regex string you desire. So, to solve your problem, just enclose your regex string in backticks instead of quotes:
err = c.Find(bson.M{"path": bson.M{"$regex": bson.RegEx{`^\\[^\\]*\\$`, ""}}}).All(&nodeList)
Go spec reference: http://golang.org/ref/spec#String_literals