I want to write a regular expression to determine whether a given string is uppercase and sorted in non-descending order.
^A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*Q*X*Y*Z*$
I was just wondering if it is possible to improve the above regex.
Examples of correct strings:
AEHII
EFKLZ
Examples of wrong strings:
AbCDE
YABKL
I want to write a regular expression ...
now you have 2 problems. :) What do you want to improve? A working solution for UTF-8 like ÄÖÜ? \$\endgroup\$AÖU
a correct string, or an incorrect one? What aboutAÄ
? AndÄA
? \$\endgroup\$