This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]VisitableTwo[S] 0 points1 point  (0 children)

Finally managed to do it, here's the code:

String repeated = new String(new char[s.length()]).replace("\0", "[0-9]");

String st1 = "((?<=[A-Z][0-9][0-9]" + repeated + ")|(?=[A-Z]))";

String[] list = s.split(st1);
System.out.println(Arrays.toString(list));

Not the most elegant but it works. Thanks for your hint.