I would like to know how to parse the last 6 digits from a Java string. So:
String input1 = "b400" // the regex should return b400
String input2 = "101010" // the regex should return 101010
String input3 = "12345678" // the regex should return 345678
No regex needed.
If it has to be a regex for API reasons,
If you need to match the last 6 codepoints (incl. supplementary codepoints), then you can replace
.with(?:[\\ud800-\\udbff][\\udc00-\\udfff]|.){0,6}