Unfortunately without more information I don’t think this question is answerable. It’s not clear exactly what is returning that error you’ve described. I’m not sure what additional information to ask for exactly, since I don’t have much to start from here, but at least a summary of what you’re trying to achieve and what you tried so far would be helpful.
With that said, I can say that Terraform doesn’t ascribe any special meaning to brackets in quoted strings, so whatever is returning this message must be in another layer below the main Terraform language implementation.
The “error parsing regexp” prefix seems to suggest that something is trying to parse this string as a regular expression. I would suggest trying to determine what is responsible for that parsing – is it being done by a provider? – and then learning from that system’s documentation how they expect you to pass literal brackets without them being interpreted as a regular expression character class.