I want to test for the entry into the terminal of a single word, i.e. 'Cat' (without anything at the end).
This allows "Cat ":
re.match(r'[A-Z]{1}[a-z]{1,15}', x)
This doesn't allow even 'Cat' to be entered!:
re.match(r'[A-Z]{1}[a-z]{1,15}[^\s]', x)
What am I doing wrong? To clarify, it asks for an input and the person has to type Cat and hit enter, no spaces at the end. Thanks! :)