I suggest either unambigous word boundaries (that match a string only if the search pattern is not enclosed with letters, digits or underscores):
String pattern = "(?<!\\w)"+Pattern.quote(subItem)+"(?!\\w)";
where (?<!\w)
matches a location not preceded with a word char and (?!\w)
fails if there is no word char immediately after the current position (see this regex demo), or, you can use a variation that takes into account leading/trailing special chars of the potential match:
String pattern = "(?:\\B(?!\\w)|\\b(?=\\w))" + Pattern.quote(subword) + "(?:(?<=\\w)\\b|(?<!\\w)\\B)";
See the regex demo.
Details:
(?:\B(?!\w)|\b(?=\w))
- either a non-word boundary if the next char is not a word char, or a word boundary if the next char is a word char
Data\[3\]
- this is a quoted subItem
(?:(?<=\w)\b|(?<!\w)\B)
- either a word boundary if the preceding char is a word char, or a non-word boundary if the preceding char is not a word char.