preg_quote

preg_quote

[code=golang]
regexp.QuoteMeta("foo[bar]")
[/code]

Result is: 
[code]
foo\[bar\]
[/code]