I want check a string with this Patern:
Pattern.compile("^0*(([a-q]{6,}|[A-Q]{6,}){6,24})(1{6,})(([a-q]{6,}|[A-Q]{6,}){6,24})(1*0*$)");
The length of [a-q]
can not be more than 6. And the length of [a-qA-Q]
can not be more than 24.
For example: max 24(min 6(aaaaaa)AAAAAAAbbbbbbbbb)111111...
But the code use the group (aaaaaa) like 1 element, and should count like 6 elements. And i need use OR to [a-q]|[A-Q].
How can i do this with 1 pattern?