how can I create simple matrix for String that could be contains following combinations
123456 ABC
123456AB1
123456AB12
123456AB123
123456
for example
if ("\\d + \\d + \\d + \\d + \\d + \\d
+ \\s
+ [a-zA-Z]+[a-zA-Z]+[a-zA-Z]") {
//passed variant from input in form 123456 ABC
} else if ("\\d + \\d + \\d + \\d + \\d + \\d
+ [a-zA-Z]+[a-zA-Z]+[a-zA-Z]
+ \\d") {
//passed variant from input in form 123456AB1
} else if ("\\d + \\d + \\d + \\d + \\d + \\d
+ [a-zA-Z]+[a-zA-Z]+[a-zA-Z]
+ \\d + \\d") {
//passed variant from input in form 123456AB12
} else if ("\\d + \\d + \\d + \\d + \\d + \\d
+ [a-zA-Z]+[a-zA-Z]+[a-zA-Z]
+ \\d + \\d + \\d") {
//passed variant from input in form 123456AB123
} else if ("\\d + \\d + \\d + \\d + \\d + \\d") {
//passed variant from input in form 0123456
} else {
//doesn't match
}