Trying to use regexp to match a value in title that has surrounding [] or () characters however seeing an unexpected error when escaping these characters. Have tried both \[ and \\[, looking for some guidance.
'{
"query": {
"regexp":{
"title": {
"value": "\[mytag\]",
}
}
}
}'
Seeing the following error:
{
"error" : {
"root_cause" : [
{
"type" : "parsing_exception",
"reason" : "Failed to parse",
"line" : 6,
"col" : 26
}
],
"type" : "parsing_exception",
"reason" : "Failed to parse",
"line" : 6,
"col" : 26,
"caused_by" : {
"type" : "json_parse_exception",
"reason" : "Unrecognized character escape '[' (code 91)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3596d5c9; line: 6, column: 29]"
}
},
"status" : 400
}