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 AA New Example C
No match
a Test BWrong NameAnother_Wrong_Name ANop3 A