I don't think the solution to Chap 7, Ex 4 is correct.

I was uncertain whether this was an error or I didn't understand your suggested exercise. In exercise 4 at the end of chapter 7 you request a regular expression that matches words with initial caps but not all caps. Your answer is /[A-Z][a-z]+/
However, that pattern won't match words with single letters like 'I' or 'A'. It will also match words like 'miDdle'. My pattern to prevent it from catching a word like 'miDdle' was /\W[A-Z][a-z]*/ but this pattern also prevented it from catching initial capped words at the beginning of a sentence. So, do I have a question? Or errata? Or am I getting too picky for a beginning exercise?

Thanks for your time.
1 person has
this question