Using grep to verify a sentence with less than 10 words (must start with a double quote then an uppercase letter and end with a dot and another double quote)
So far this is my code:
echo -e "\"This is a sentence.\""| grep -E '"[[:upper:]][[:upper:][:lower:] ]{1,10}\."'
The problem is: it seems to count the letters rather than the words. I wonder if there is any way to limit the words to just 10.
Any of your opinion is highly regarded.
Why use grep?
wc
- word count.