43
You were almost there, you may use this regex solution:
word.matches("^[0-9,;]+$");
RegEx Details:
^: Start[0-9,;]+: Match 1+ of a digit or , or ; characters$: EndNote that when we use .matches() start and end anchors are implied since it only matches complete input so you may omit anchors in your regex to make it:
word.matches("[0-9,;]+");