only one letter can be written/selected as value, excepted for I, O, Q, S, X, Y, Z.
I've tried :
String regex="^(?!.*(.).*\1)([ABCDEFGHJKLMNPTURVW])+$|((?!OIXZYQS).)+$"
only one letter can be written/selected as value, excepted for I, O, Q, S, X, Y, Z.
I've tried :
String regex="^(?!.*(.).*\1)([ABCDEFGHJKLMNPTURVW])+$|((?!OIXZYQS).)+$"
Not so clear... To only allow upper alphabetic but disallow certain duplicated, e.g.
^(?!.*?([A-HJ-NPRT-W]).*\1)[A-Z]+$
The lookahead at ^
start checks if there is not another of [A-HJ-NPRT-W]
by capturing.
You could also do it like this which is slightly less efficient and maybe harder to maintain.