You just need to escape them with backslashes.
However, because the regex is in a double quoted string, backslashes need to be escaped
beg_ere = "^[[:space:]]*([#;!]+|@c|//)[[:space:]]+(HD) \\[([[:graph:]]+)\\]([[:space:]]*).*$"
# .....................................................^^^..............^^^