That is my regular expression:
[A-Ö]{1}[a-ö]
When I write that everything is fine until I write another small letter it doesn't work. E.g. Ab
works, but Cmo
or Klfdklgklhsh
don't work. How can I do this?
EDIT BASED ON COMMENTS:
If I use [A-Ö]{1}[a-ö]+
then it also supports ab
, klofn
and nnn
for example. I need for the first letter to be only a capital letter.
The * means zero or more, if you require a lowercase letter to follow, then use
Note that
[A-Ö]
matches all lower and uppercase letters and a lot of other symbols, too.You need
See regex demo
Note that
+
matches 1 or more occurrences of the preceding subpattern.