Regex validating csv strings
The comma in your regexp is optional that fact allows "0101 9 1 1 1 1 1 1 1 1 1" to be freely parsed as two or more records.
To fix this, you may demand it to be either exactly one ident or several comma-separated ones:
final String pattern = String.format("(%s\\s*,\\s*){0,4}%s",base,base);
Also I would recommend to make base itself more strict with respect to your input rules, although it doesn't seem to be directly relevant to the issue.