Mark the beginning and end of the line with the ^ and $ anchors:
String pattern = "^([0-9]{15})$";
^ matches the position at the beginning of the line$ matches position at end of line
Without these anchors, you are only looking for 15 consecutive digits within a string. Corresponding lines may additionally contain more digits (or even contain letters), although they still match.
(In addition, your inner pair of brackets is redundant - I deleted it. If you get access to the value of the entire match, and not to the value removed by the first group, you can even release other parentheses: T25>)
Regex101 demo
source share