Your regex matching is incorrect. The value of Person is [{age=6,name=AAA}]
, so your matcher will need to capture all of that to be considered a match. You've used some special characters that need escaping, as well as an invalid capture group (which I don't think we really need here.) Without any more guidance from your post on what you precisely need to match, here's two rough ideas:
"Person": {
"matches": "^\[.*\]$"
}
The above just matches any character, an unlimited amount of times, between brackets.
"Person": {
"matches": "^\[\{age=\d*,name=\w*\}\]$"
}
The above matches any digit character, an unlimited amount of times, as well as any word character, an unlimited amount of times, so long as the rest of the value looks like [{age=,name=}]
.
I would advise you to take a look at a regex tool to work on forming these. My personal favorite is regex101.