I need a regex which is matched when the string doesn't have both lowercase and uppercase letters.
For example
abc
, ABC
, 123
, abc123
, ABC123&^
- should match
AbC
, A12b
, AB^%12c
- should not match
Basically I need an inverse/negation of the following regex:
^(?=.*[a-z])(?=.*[A-Z]).+$
Does not sound like any lookarounds would be needed.
Either match only characters that are not a-z
or only characters, that are not A-Z
.
^(?:[^a-z]+|[^A-Z]+)$