I'm trying to find the regex expression that validates a specific rule, but I'm quite a beginner with regular expressions.
Rule
- There can be any number of words
- Words are space-separated
- Words only contain letters
- Words start with a capital
- The last word must be a single capitalized character
Expression
Here is where I am so far: ([A-Z][a-z]+[ ]*)*[A-Z]
Examples
Match
Example Name A
A New Example C
No match
a Test B
Wrong Name
Another_Wrong_Name A
Nop3 A